mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-02-11 06:09:06 +00:00
75 lines
3.4 KiB
Plaintext
75 lines
3.4 KiB
Plaintext
@using AIStudio.Chat
|
|
@using AIStudio.Components.Pages
|
|
@using AIStudio.Tools
|
|
<MudText Typo="Typo.h3" Class="mb-2 mr-3">
|
|
@this.Title
|
|
</MudText>
|
|
|
|
<InnerScrolling HeaderHeight="12.3em">
|
|
<ChildContent>
|
|
<MudForm @ref="@this.form" @bind-IsValid="@this.inputIsValid" @bind-Errors="@this.inputIssues" Class="pr-2">
|
|
<MudText Typo="Typo.body1" Align="Align.Justify" Class="mb-6">
|
|
@this.Description
|
|
</MudText>
|
|
|
|
@if (this.Body is not null)
|
|
{
|
|
@this.Body
|
|
}
|
|
</MudForm>
|
|
<Issues IssuesData="@this.inputIssues"/>
|
|
|
|
@if (this.ShowDedicatedProgress && this.isProcessing)
|
|
{
|
|
<MudProgressLinear Color="Color.Primary" Indeterminate="true" Class="mb-6" />
|
|
}
|
|
<div id="@ASSISTANT_RESULT_DIV_ID" class="mr-2 mt-3">
|
|
@if (this.ShowResult && this.resultingContentBlock is not null)
|
|
{
|
|
<ContentBlockComponent Role="@this.resultingContentBlock.Role" Type="@this.resultingContentBlock.ContentType" Time="@this.resultingContentBlock.Time" Content="@this.resultingContentBlock.Content"/>
|
|
}
|
|
</div>
|
|
|
|
<div id="@AFTER_RESULT_DIV_ID" class="mt-3">
|
|
</div>
|
|
|
|
@if (this.FooterButtons.Count > 0)
|
|
{
|
|
<MudStack Row="@true" Wrap="Wrap.Wrap" Class="mt-3 mr-2">
|
|
@foreach (var button in this.FooterButtons)
|
|
{
|
|
switch (button)
|
|
{
|
|
case ButtonData buttonData when !string.IsNullOrWhiteSpace(buttonData.Tooltip):
|
|
<MudTooltip Text="@buttonData.Tooltip">
|
|
<MudButton Variant="Variant.Filled" Color="@buttonData.Color" StartIcon="@GetButtonIcon(buttonData.Icon)" OnClick="async () => await buttonData.AsyncAction()">
|
|
@buttonData.Text
|
|
</MudButton>
|
|
</MudTooltip>
|
|
break;
|
|
|
|
case ButtonData buttonData:
|
|
<MudButton Variant="Variant.Filled" Color="@buttonData.Color" StartIcon="@GetButtonIcon(buttonData.Icon)" OnClick="async () => await buttonData.AsyncAction()">
|
|
@buttonData.Text
|
|
</MudButton>
|
|
break;
|
|
|
|
case SendToButton sendToButton:
|
|
<MudMenu StartIcon="@Icons.Material.Filled.Apps" EndIcon="@Icons.Material.Filled.KeyboardArrowDown" Label="Send to ..." Variant="Variant.Filled" Color="Color.Info">
|
|
@foreach (var assistant in Enum.GetValues<SendToAssistant>().OrderBy(n => n.Name().Length))
|
|
{
|
|
if(assistant is Pages.SendToAssistant.NONE || sendToButton.Self == assistant)
|
|
continue;
|
|
|
|
<MudMenuItem OnClick="() => this.SendToAssistant(assistant, sendToButton)">
|
|
@assistant.Name()
|
|
</MudMenuItem>
|
|
}
|
|
</MudMenu>
|
|
break;
|
|
}
|
|
}
|
|
</MudStack>
|
|
}
|
|
</ChildContent>
|
|
</InnerScrolling> |