@using Microsoft.AspNetCore.Components
@inject NavigationManager Navigation
@code {
[Parameter] public string Url { get; set; } = "/";
[Parameter] public string Comprobante { get; set; } = "Ver";
[Parameter] public string Style { get; set; } = "success";
[Parameter] public EventCallback OnLinkClick { get; set; }
async void LinkClicked(MouseEventArgs e)
{
if (OnLinkClick.HasDelegate)
await OnLinkClick.InvokeAsync(null);
else
Navigation.NavigateTo(Url);
}
string GetBackgroundColor() => Style.ToLower() switch
{
"success" => "#28a745",
"danger" => "#dc3545",
"primary" => "#007bff",
"dark" => "#343a40",
"info" => "#17a2b8",
"warning" => "#ffc107",
"secondary" => "#6c757d",
"light" => "#f8f9fa",
"muted" => "#6c757d",
"orange" => "#fd7e14",
"cyan" => "#0dcaf0",
"purple" => "#6f42c1",
"pink" => "#d63384",
"lime" => "#84cc16",
"indigo" => "#6610f2",
"rose" => "#e11d48",
"emerald" => "#10b981",
"amber" => "#d97706",
"violet" => "#7c3aed",
"slate" => "#64748b",
_ => "#6c757d" // fallback secondary
};
}