mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-08-21 04:12:56 +00:00
Update ChatTemplateDialog to handle text and image content types
This commit is contained in:
parent
b36679d90a
commit
9c5647176d
@ -81,7 +81,24 @@
|
|||||||
<MudTh>@T("Actions")</MudTh>
|
<MudTh>@T("Actions")</MudTh>
|
||||||
</HeaderContent>
|
</HeaderContent>
|
||||||
<RowTemplate>
|
<RowTemplate>
|
||||||
@(context.Content is ContentText textContent ? textContent.Text : context.Content?.ToString())
|
<MudTd>
|
||||||
|
@context.Role.ToChatTemplateName()
|
||||||
|
</MudTd>
|
||||||
|
<MudTd>
|
||||||
|
@switch(context.Content)
|
||||||
|
{
|
||||||
|
case ContentText textContent:
|
||||||
|
<MudTextField AutoGrow="true" Value="@textContent.Text" Placeholder="@T("Enter a message")" ReadOnly="true" Variant="Variant.Text" Validation="@this.ValidateExampleTextMessage"/>
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ContentImage { SourceType: ContentImageSource.URL or ContentImageSource.LOCAL_PATH } imageContent:
|
||||||
|
<MudImage Src="@imageContent.Source" Alt="@T("Image content")" Fluid="true" />
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
@T("Unsupported content type")
|
||||||
|
break;
|
||||||
|
}
|
||||||
</MudTd>
|
</MudTd>
|
||||||
<MudTd style="text-align: center">
|
<MudTd style="text-align: center">
|
||||||
<MudIconButton Color="Color.Primary" Icon="@Icons.Material.Filled.Add" OnClick="@(() => AddNewMessageBelow(context))" />
|
<MudIconButton Color="Color.Primary" Icon="@Icons.Material.Filled.Add" OnClick="@(() => AddNewMessageBelow(context))" />
|
||||||
|
Loading…
Reference in New Issue
Block a user