mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-02-15 19:01:36 +00:00
Made the file list scrollable
This commit is contained in:
parent
4cefc6243c
commit
7dd505b554
@ -13,57 +13,59 @@
|
|||||||
|
|
||||||
<MudDivider Class="mt-3 mb-3"/>
|
<MudDivider Class="mt-3 mb-3"/>
|
||||||
|
|
||||||
@if (!this.DocumentPaths.Any())
|
<div style="max-height: 50vh; overflow-y: auto; padding-right: 8px;">
|
||||||
{
|
@if (!this.DocumentPaths.Any())
|
||||||
<MudJustifiedText Typo="Typo.body1" Class="mt-3">
|
|
||||||
@T("There aren’t any file attachments available right now.")
|
|
||||||
</MudJustifiedText>
|
|
||||||
}
|
|
||||||
|
|
||||||
@foreach (var filePath in this.DocumentPaths)
|
|
||||||
{
|
|
||||||
@if (File.Exists(filePath))
|
|
||||||
{
|
{
|
||||||
<MudStack Row Justify="Justify.SpaceBetween" AlignItems="AlignItems.Center" Class="mb-2">
|
<MudJustifiedText Typo="Typo.body1" Class="mt-3">
|
||||||
<MudTooltip Text="@T("Your attached file")" Placement="Placement.Bottom">
|
@T("There aren't any file attachments available right now.")
|
||||||
<span class="d-inline-flex align-items-center" style="max-width: 100%;">
|
</MudJustifiedText>
|
||||||
<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">
|
@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"
|
<MudIconButton Icon="@Icons.Material.Filled.Delete"
|
||||||
Color="Color.Error"
|
Color="Color.Error"
|
||||||
Class="ml-2"
|
Class="ml-2"
|
||||||
OnClick="@(() => DeleteAttachment(filePath))"/>
|
OnClick="@(() => DeleteAttachment(filePath))"/>
|
||||||
</MudTooltip>
|
</MudTooltip>
|
||||||
</MudStack>
|
</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>
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
</div>
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
<DialogActions>
|
<DialogActions>
|
||||||
<MudButton OnClick="@this.Close" Variant="Variant.Filled" Color="Color.Primary">
|
<MudButton OnClick="@this.Close" Variant="Variant.Filled" Color="Color.Primary">
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user