mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-04-28 18:19:48 +00:00
Allow one to show an end button
This commit is contained in:
parent
3fd0d4d5c1
commit
aae5ad18db
@ -3,6 +3,20 @@
|
||||
<div class="d-flex align-center">
|
||||
<MudIcon Icon="@this.HeaderIcon" Size="@this.IconSize" Color="@this.IconColor" class="mr-3"/>
|
||||
<MudText Typo="Typo.h6">@this.HeaderText</MudText>
|
||||
@if (this.ShowEndButton)
|
||||
{
|
||||
<MudSpacer/>
|
||||
if (!string.IsNullOrWhiteSpace(this.EndButtonTooltip))
|
||||
{
|
||||
<MudTooltip Text="@this.EndButtonTooltip">
|
||||
<MudIconButton Icon="@this.EndButtonIcon" Color="@this.EndButtonColor" Size="Size.Medium" OnClick="async () => await this.EndButtonClickAsync()"/>
|
||||
</MudTooltip>
|
||||
}
|
||||
else
|
||||
{
|
||||
<MudIconButton Icon="@this.EndButtonIcon" Color="@this.EndButtonColor" Size="Size.Medium" OnClick="async () => await this.EndButtonClickAsync()"/>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
</TitleContent>
|
||||
<ChildContent>
|
||||
|
@ -21,4 +21,19 @@ public partial class ExpansionPanel : ComponentBase
|
||||
|
||||
[Parameter]
|
||||
public bool IsExpanded { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public bool ShowEndButton { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public Func<ValueTask> EndButtonClickAsync { get; set; } = () => ValueTask.CompletedTask;
|
||||
|
||||
[Parameter]
|
||||
public string EndButtonIcon { get; set; } = Icons.Material.Filled.Delete;
|
||||
|
||||
[Parameter]
|
||||
public Color EndButtonColor { get; set; } = Color.Error;
|
||||
|
||||
[Parameter]
|
||||
public string EndButtonTooltip { get; set; } = string.Empty;
|
||||
}
|
Loading…
Reference in New Issue
Block a user