mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-11-23 10:50:21 +00:00
Documents can now be removed individually
This commit is contained in:
parent
01c48e14df
commit
fe26495cd6
@ -8,7 +8,9 @@
|
|||||||
</MudText>
|
</MudText>
|
||||||
@foreach (var fileInfo in this.DocumentPaths.Select(file => new FileInfo(file)))
|
@foreach (var fileInfo in this.DocumentPaths.Select(file => new FileInfo(file)))
|
||||||
{
|
{
|
||||||
<MudChip T="string" Color="Color.Dark" Text="@fileInfo.Name" tabindex="-1" />
|
<MudBadge Origin="Origin.TopCenter" Icon="@Icons.Material.Filled.Search" Color="Color.Primary" Overlap="true" Bordered="true" OnClick="@(() => this.InvestigateFile(@fileInfo))">
|
||||||
|
<MudChip T="string" Color="Color.Dark" Text="@fileInfo.Name" tabindex="-1" Icon="@Icons.Material.Filled.Search" OnClick="@(() => this.InvestigateFile(@fileInfo))" OnClose="@(() => this.RemoveDocumentPathFromDocumentPaths(@fileInfo))"/>
|
||||||
|
</MudBadge>
|
||||||
}
|
}
|
||||||
</MudPaper>
|
</MudPaper>
|
||||||
</MudLink>
|
</MudLink>
|
||||||
|
|||||||
@ -151,4 +151,23 @@ public partial class AttachDocuments : MSGComponentBase
|
|||||||
this.ClearDragClass();
|
this.ClearDragClass();
|
||||||
this.StateHasChanged();
|
this.StateHasChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private async Task RemoveDocumentPathFromDocumentPaths(FileInfo file)
|
||||||
|
{
|
||||||
|
this.DocumentPaths.Remove(file.ToString());
|
||||||
|
|
||||||
|
await this.DocumentPathsChanged.InvokeAsync(this.DocumentPaths);
|
||||||
|
await this.OnChange(this.DocumentPaths);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The user might want to check what the Pandoc integration actually extracts from his file and therefore gives the LLM as input.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="file">The file to check.</param>
|
||||||
|
private void InvestigateFile(FileInfo file)
|
||||||
|
{
|
||||||
|
# warning Implement Investigation of file
|
||||||
|
this.Logger.LogDebug("Investigate");
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user