@using Iceshrimp.Assets.PhosphorIcons
<div @onclick="OnClick" class="menu-element @(Danger ? "danger" : "")">
    @if (Icon != null)
    {
        <Icon Name="Icon"></Icon>
    }
    @Text
</div>

@code {
    [Parameter]                  public          IconName?      Icon     { get; set; }
    [Parameter] [EditorRequired] public required RenderFragment Text     { get; set; }
    [Parameter] [EditorRequired] public required EventCallback  OnSelect { get; set; }
    [Parameter]                  public          bool           Danger   { get; set; }

    private async Task OnClick()
    {
        await OnSelect.InvokeAsync();
    }
}