@* A chip (SPEC §10.5.2, §10.7). Info chips summarise a condition: icon, a short label and a bold value ("Pagamento
RB 60 gg"). With OnRemove it becomes a filter chip with a remove button. *@
@if (OnRemove.HasDelegate)
{
@Text @Value
}
else
{
@if (Icon is not null)
{
}
@Text
@if (Value is not null)
{
@Value
}
}
@code {
/// The icon.
[Parameter]
public string? Icon { get; set; }
/// The label.
[Parameter]
public string? Text { get; set; }
/// The value, in bold.
[Parameter]
public string? Value { get; set; }
/// A tooltip with the details.
[Parameter]
public string? Title { get; set; }
/// The tone: accent, warning, error.
[Parameter]
public KhTone Tone { get; set; }
/// Makes it a removable filter chip.
[Parameter]
public EventCallback OnRemove { get; set; }
private string? ToneClass => Tone switch
{
KhTone.Accent => "acc",
KhTone.Warning => "warn",
KhTone.Error => "err",
_ => null,
};
}