Add Text parameter to customize button label

This commit is contained in:
Thorsten Sommer 2025-10-28 10:19:54 +01:00
parent b6399967e5
commit 679591dba1
Signed by: tsommer
GPG Key ID: 371BBA77A02C0108
2 changed files with 11 additions and 1 deletions

View File

@ -1,4 +1,11 @@
@inherits MSGComponentBase @inherits MSGComponentBase
<MudButton StartIcon="@Icons.Material.Filled.Description" OnClick="async () => await this.SelectFile()" Variant="Variant.Filled" Class="mb-3"> <MudButton StartIcon="@Icons.Material.Filled.Description" OnClick="async () => await this.SelectFile()" Variant="Variant.Filled" Class="mb-3">
@T("Use file content as input") @if (string.IsNullOrWhiteSpace(this.Text))
{
@T("Use file content as input")
}
else
{
@this.Text
}
</MudButton> </MudButton>

View File

@ -7,6 +7,9 @@ namespace AIStudio.Components;
public partial class ReadFileContent : MSGComponentBase public partial class ReadFileContent : MSGComponentBase
{ {
[Parameter]
public string Text { get; set; } = string.Empty;
[Parameter] [Parameter]
public string FileContent { get; set; } = string.Empty; public string FileContent { get; set; } = string.Empty;