AI-Studio/app/MindWork AI Studio/Components/ReadFileContent.razor
2026-09-10 15:28:08 +02:00

62 lines
2.8 KiB
Plaintext

@inherits MSGComponentBase
@if (this.EnableDragDrop)
{
<PathDropZone IdPrefix="read-file-content"
CatchAllDocuments="@this.CatchAllDocuments"
Disabled="@(() => this.IsUnavailable)"
OnPathsDropped="@this.LoadFirstValidFile">
<MudStack Row="true" AlignItems="AlignItems.Center" StretchItems="StretchItems.None" Wrap="Wrap.Wrap">
@if (this.ShowAttachedDocumentState && this.hasLoadedFileContent)
{
<MudTooltip Text="@this.FileLoadedTooltip()">
<MudBadge Icon="@Icons.Material.Filled.Check" Color="Color.Success" Overlap="true">
<MudButton StartIcon="@Icons.Material.Filled.Description" OnClick="@(async () => await this.SelectFile())" Variant="Variant.Filled" Disabled="@this.IsUnavailable">
@this.ButtonText
</MudButton>
</MudBadge>
</MudTooltip>
}
else
{
<MudButton StartIcon="@Icons.Material.Filled.Description" OnClick="@(async () => await this.SelectFile())" Variant="Variant.Filled" Disabled="@this.IsUnavailable">
@this.ButtonText
</MudButton>
}
@if (this.IsCurrentTargetBusy)
{
<MediaTranscriptionStatus Owner="@this.EffectiveImportOwner" TargetId="@this.EffectiveMediaImportTarget.TargetId" Compact="true"/>
}
else
{
<MudText Typo="Typo.body2">
@T("Drop one file here to load its content.")
</MudText>
}
</MudStack>
</PathDropZone>
}
else
{
<MudStack Row="true" AlignItems="AlignItems.Center" StretchItems="StretchItems.None" Wrap="Wrap.Wrap" Class="mb-3">
@if (this.ShowAttachedDocumentState && this.hasLoadedFileContent)
{
<MudTooltip Text="@this.FileLoadedTooltip()">
<MudBadge Icon="@Icons.Material.Filled.Check" Color="Color.Success" Overlap="true">
<MudButton StartIcon="@Icons.Material.Filled.Description" OnClick="@(async () => await this.SelectFile())" Variant="Variant.Filled" Disabled="@this.IsUnavailable">
@this.ButtonText
</MudButton>
</MudBadge>
</MudTooltip>
}
else
{
<MudButton StartIcon="@Icons.Material.Filled.Description" OnClick="@(async () => await this.SelectFile())" Variant="Variant.Filled" Disabled="@this.IsUnavailable">
@this.ButtonText
</MudButton>
}
<MediaTranscriptionStatus Owner="@this.EffectiveImportOwner" TargetId="@this.EffectiveMediaImportTarget.TargetId" Compact="true"/>
</MudStack>
}