AI-Studio/app/MindWork AI Studio/Dialogs/ReviewAttachmentsDialog.razor

69 lines
3.2 KiB
Plaintext
Raw Normal View History

2025-12-15 13:13:36 +00:00
@inherits MSGComponentBase
<MudDialog>
<TitleContent>
2025-12-17 18:45:15 +00:00
@T("Your attached files")
2025-12-15 13:13:36 +00:00
</TitleContent>
<DialogContent>
<MudJustifiedText Typo="Typo.body1" Class="mb-3">
@T("Here you can see all attached files. Files that can no longer be found (deleted, renamed, or moved) are marked with a warning icon and a strikethrough name. You can remove any attachment using the trash can icon.")
</MudJustifiedText>
2025-12-17 17:40:08 +00:00
<MudDivider Class="mt-3 mb-3"/>
@if (!this.DocumentPaths.Any())
{
<MudJustifiedText Typo="Typo.body1" Class="mt-3">
@T("There arent any file attachments available right now.")
</MudJustifiedText>
}
2025-12-15 13:13:36 +00:00
@foreach (var filePath in this.DocumentPaths)
{
@if (File.Exists(filePath))
{
<MudStack Row Justify="Justify.SpaceBetween" AlignItems="AlignItems.Center" Class="mb-2">
<MudTooltip Text="@T("Your attached file")" Placement="Placement.Bottom">
<span class="d-inline-flex align-items-center" style="max-width: 100%;">
<MudIcon Icon="@Icons.Material.Filled.AttachFile" Class="mr-2"/>
<MudText Class="flex-grow-1 overflow-hidden text-ellipsis" Style="white-space: nowrap;">
@Path.GetFileName(filePath)
</MudText>
</span>
</MudTooltip>
<MudTooltip Text="@T("Delete")" Placement="Placement.Bottom">
<MudIconButton Icon="@Icons.Material.Filled.Delete"
Color="Color.Error"
Class="ml-2"
OnClick="@(() => DeleteAttachment(filePath))"/>
</MudTooltip>
</MudStack>
}
else
{
<MudStack Row Justify="Justify.SpaceBetween" AlignItems="AlignItems.Center" Class="mb-2">
<MudTooltip Text="@T("The file was deleted, renamed, or moved")" Placement="Placement.Bottom">
<span class="d-inline-flex align-items-center" style="max-width: 100%;">
<MudIcon Icon="@Icons.Material.Filled.Report" Color="Color.Error" Class="mr-2"/>
<MudText Class="flex-grow-1 overflow-hidden text-ellipsis" Style="white-space: nowrap;">
<s>@Path.GetFileName(filePath)</s>
</MudText>
</span>
</MudTooltip>
<MudTooltip Text="@T("Delete")" Placement="Placement.Bottom">
<MudIconButton Icon="@Icons.Material.Filled.Delete"
Color="Color.Error"
Class="ml-2"
OnClick="@(() => DeleteAttachment(filePath))"/>
</MudTooltip>
</MudStack>
}
2025-12-15 13:13:36 +00:00
}
</DialogContent>
<DialogActions>
<MudButton OnClick="@this.Close">Close</MudButton>
2025-12-15 13:13:36 +00:00
</DialogActions>
</MudDialog>