<button @onclick="OnClick" class="@ExtraClasses" aria-label="@AriaLabel" disabled="@Disabled">
    @(State switch
    {
        StateEnum.Initial => Initial,
        StateEnum.Loading => Loading,
        StateEnum.Failed  => Failed,
        StateEnum.Success => Success,
        _                 => throw new ArgumentOutOfRangeException()
    })
</button>

@code {
    [Parameter] [EditorRequired] public required EventCallback  OnClick      { get; set; }
    [Parameter] [EditorRequired] public required RenderFragment Initial      { get; set; }
    [Parameter] [EditorRequired] public required RenderFragment Loading      { get; set; }
    [Parameter] [EditorRequired] public required RenderFragment Failed       { get; set; }
    [Parameter] [EditorRequired] public required RenderFragment Success      { get; set; }
    [Parameter]                  public          string?        ExtraClasses { get; set; }
    // this is godawful but properties can't have dashes and I'm not actually sure how else to do this:
    [Parameter]                  public          string?        AriaLabel { get; set; }
    [Parameter]                  public          bool?          Disabled  { get; set; }
        public                                       StateEnum      State        { get; set; }

    public enum StateEnum
    {
        Initial,
        Loading,
        Failed,
        Success
    }
}