@inject IJSRuntime JsRuntime
@inject NavigationManager NavigationManager

@if (IsLink)
{
    <a @onclick="AddrRedirect">@Name</a>
}
else
{
    <button @onclick="AddrRedirect">@Name</button>
}

@code
{
    [Parameter] public string? Name { get; set; }

    [Parameter] public string? Code { get; set; }

    [Parameter]
    public bool IsLink { get; set; }

    private void AddrRedirect()
    {
        var address = $"https://dixielandsoftware.net/cgi-bin/solari_relay.pl?data={Code}";

        NavigationManager.NavigateTo(address);
    }
}