2026-07-19 07:25:27 +00:00
|
|
|
@* Skeleton loading placeholder for cards and content areas. *@
|
|
|
|
|
|
2026-08-10 22:36:18 +02:00
|
|
|
<MudPaper Elevation="0" Class="@($"pa-4 {Class}")" Style="border-radius: var(--hmd-radius-lg); border: 1px solid var(--mud-palette-lines-default);">
|
2026-07-19 07:25:27 +00:00
|
|
|
@if (ShowTitle)
|
|
|
|
|
{
|
2026-07-27 20:11:31 +00:00
|
|
|
<MudSkeleton Width="180px" Height="22px" Style="border-radius:6px;" />
|
2026-07-19 07:25:27 +00:00
|
|
|
}
|
|
|
|
|
@for (int i = 0; i < LineCount; i++)
|
|
|
|
|
{
|
2026-07-27 20:11:31 +00:00
|
|
|
<MudSkeleton Width="@GetWidth(i)" Height="42px"
|
|
|
|
|
Style="border-radius:8px;"
|
|
|
|
|
Class="@(i > 0 || ShowTitle ? "mt-2" : "")" />
|
2026-07-19 07:25:27 +00:00
|
|
|
}
|
|
|
|
|
</MudPaper>
|
|
|
|
|
|
|
|
|
|
@code {
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Number of skeleton content lines to render. Defaults to 4.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[Parameter]
|
|
|
|
|
public int LineCount { get; set; } = 4;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Whether to show a title skeleton row at the top. Defaults to true.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[Parameter]
|
|
|
|
|
public bool ShowTitle { get; set; } = true;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Additional CSS classes applied to the paper.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[Parameter]
|
|
|
|
|
public string Class { get; set; } = string.Empty;
|
|
|
|
|
|
2026-07-27 20:11:31 +00:00
|
|
|
private string GetWidth(int index) => (index % 3) switch
|
|
|
|
|
{
|
|
|
|
|
0 => "100%",
|
|
|
|
|
1 => "85%",
|
|
|
|
|
_ => "92%"
|
|
|
|
|
};
|
|
|
|
|
|
2026-07-19 07:25:27 +00:00
|
|
|
}
|