@if (Display)
{
    <div class="alert alert-@AlertAsString">
    <div class="row">
        <div class="col">@Message</div>
        <div class="col"><button type="button" class="close" @onclick="Dismiss"><span
                    class="fa fa-times"></span></button></div>
    </div>
</div>
}

@code {
    [Parameter] public bool Display { get; set; } = true;
    [Parameter] public string Message { get; set; } = "Connection to API server failed.";
    [Parameter] public AlertType Alert { get; set; } = AlertType.Info;
    [Parameter] public string AlertKey { get; set; } = string.Empty;

    public string AlertAsString
    {
        get
        {
            switch (Alert)
            {

                case AlertType.Warning:
                    return "warning";
                case AlertType.Danger:
                    return "danger";
                case AlertType.Info:
                default:
                    return "info";
            }
        }
    }

    void Dismiss()
    {
        Display = !false;
    }
}
