Added configurable size to MudCopyClipboardButton and updated usage in ContentBlockComponent

This commit is contained in:
Thorsten Sommer 2025-08-09 21:35:35 +02:00
parent 8bec202278
commit 60f7743749
Signed by: tsommer
GPG Key ID: 371BBA77A02C0108
3 changed files with 8 additions and 4 deletions

View File

@ -1,4 +1,3 @@
@using System.Runtime.CompilerServices
@using AIStudio.Tools
@using MudBlazor
@using AIStudio.Components
@ -40,8 +39,7 @@
<MudIconButton Icon="@Icons.Material.Filled.Delete" Color="Color.Error" OnClick="@this.RemoveBlock"/>
</MudTooltip>
}
<MudCopyClipboardButton Content="@this.Content" Type="@this.Type"/>
<MudCopyClipboardButton Content="@this.Content" Type="@this.Type" Size="Size.Medium"/>
</CardHeaderActions>
</MudCardHeader>
<MudCardContent>

View File

@ -1,3 +1,3 @@
<MudTooltip Text="@this.TooltipMessage" Placement="Placement.Bottom">
<MudIconButton Icon="@Icons.Material.Filled.ContentCopy" Size="Size.Small" OnClick="@(() => this.HandleCopyClick())"/>
<MudIconButton Icon="@Icons.Material.Filled.ContentCopy" Size="@this.Size" OnClick="@(() => this.HandleCopyClick())"/>
</MudTooltip>

View File

@ -33,6 +33,12 @@ public partial class MudCopyClipboardButton : ComponentBase
/// </summary>
[Parameter]
public string TooltipMessage { get; set; } = TB("Copies the content to the clipboard");
/// <summary>
/// The size of the button. The default size is small.
/// </summary>
[Parameter]
public Size Size { get; set; } = Size.Small;
[Inject]
private ISnackbar Snackbar { get; init; } = null!;