Files
AI-Studio/app/MindWork AI Studio/Components/SourcePassageView.razor
T

45 lines
2.0 KiB
Plaintext

@using AIStudio.Tools.RAG
@inherits MSGComponentBase
@if (this.Passage.Category is RetrievalContentCategory.IMAGE)
{
<MudAlert Severity="Severity.Info" Variant="Variant.Outlined">
@T("An image matched here. The AI was told about it and where to find it, but it did not receive the image itself.")
</MudAlert>
}
else
{
@if (this.isStoreUnavailable)
{
<MudAlert Severity="Severity.Warning" Variant="Variant.Outlined" Class="mb-2">
<MudStack Row="true" AlignItems="AlignItems.Center" Justify="Justify.SpaceBetween" Wrap="Wrap.Wrap">
<MudText>@T("At the moment, AI Studio cannot read the text of this passage that the AI received, e.g., while AI Studio is still starting.")</MudText>
<MudButton Variant="Variant.Outlined" Color="Color.Warning" StartIcon="@Icons.Material.Filled.Refresh" OnClick="@this.ReadTextAgainAsync">
@T("Try again")
</MudButton>
</MudStack>
</MudAlert>
}
else if (this.isTextMissing)
{
<MudAlert Severity="Severity.Info" Variant="Variant.Outlined" Class="mb-2">
@T("AI Studio no longer has the text of this passage that the AI received. Only where it was found is still known.")
</MudAlert>
}
else if (this.isReadingText)
{
<MudProgressLinear Indeterminate="@true" Color="Color.Primary" Size="Size.Small" Class="mb-2"/>
}
<ContentViewer Text="@this.text" MaxHeight="@this.MaxHeight">
<Toolbar>
@* The heading takes the free width, so the button stands right, next to the views. The
title of the dialog warns about a file which is no longer at its place. *@
<MudText Typo="Typo.subtitle2" Class="flex-grow-1">
@this.heading
</MudText>
<FileActions Path="@this.openPath" PageNumber="@this.openPage" ShowCopy="@false" ShowFileManager="@false" WarnIfMissing="@false"/>
</Toolbar>
</ContentViewer>
}