Refactored expansion panels into its own component

This commit is contained in:
tsommer committed 2024-06-01 20:48:24 +02:00
1 parent fa80e5c1c0
commit 723166aa49
4 files changed
+98 -112

No files matched your search

@@ -0,0 +1,11 @@
<MudExpansionPanel Class="border-solid border rounded-lg" IsInitiallyExpanded="@this.IsExpanded">
<TitleContent>
<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>
</div>
</TitleContent>
<ChildContent>
@this.ChildContent
</ChildContent>
</MudExpansionPanel>
@@ -0,0 +1,24 @@
using Microsoft.AspNetCore.Components;
namespace AIStudio.Components.Blocks;
public partial class ExpansionPanel : ComponentBase
{
[Parameter]
public string HeaderIcon { get; set; } = Icons.Material.Filled.BugReport;
[Parameter]
public Size IconSize { get; set; } = Size.Medium;
[Parameter]
public Color IconColor { get; set; } = Color.Primary;
[Parameter]
public string HeaderText { get; set; } = "n/a";
[Parameter]
public RenderFragment? ChildContent { get; set; }
[Parameter]
public bool IsExpanded { get; set; }
}