@* MetricTile.razor — tuile de métrique compacte (label + valeur + jauge optionnelle). *@ @using MudBlazor @if (Icon is not null) { } @Label @Value @if (Progress is { } p) { } @code { [Parameter, EditorRequired] public string Label { get; set; } = ""; [Parameter, EditorRequired] public string Value { get; set; } = "—"; [Parameter] public Color Color { get; set; } = Color.Default; [Parameter] public Color ProgressColor { get; set; } = Color.Primary; [Parameter] public double? Progress { get; set; } [Parameter] public string? Icon { get; set; } private static string ColorToCss(Color color) => color switch { Color.Primary => "var(--mud-palette-primary)", Color.Secondary => "var(--mud-palette-secondary)", Color.Info => "var(--mud-palette-info)", Color.Success => "var(--mud-palette-success)", Color.Warning => "var(--mud-palette-warning)", Color.Error => "var(--mud-palette-error)", _ => "var(--mud-palette-text-primary)", }; }