@inject NotificationService NotificationService

<RadzenText TextStyle="TextStyle.Subtitle1" TagName="TagName.H3" class="rz-mt-4">Icon only button</RadzenText>
<RadzenStack Orientation="Orientation.Horizontal" AlignItems="AlignItems.Center" Gap="1rem" Wrap="FlexWrap.Wrap">
    <RadzenSplitButton Click=@(args => OnClick(args, "SplitButton with icon")) Icon="account_circle">
        <ChildContent>
            <RadzenSplitButtonItem Text="Item1" Value="1" Icon="account_box" />
            <RadzenSplitButtonItem Text="Item2" Value="2" Icon="account_balance_wallet" />
        </ChildContent>
    </RadzenSplitButton>
</RadzenStack>

<RadzenText TextStyle="TextStyle.Subtitle1" TagName="TagName.H3" class="rz-mt-4">Icon and text button</RadzenText>
<RadzenStack Orientation="Orientation.Horizontal" AlignItems="AlignItems.Center" Gap="1rem" Wrap="FlexWrap.Wrap">
    <RadzenSplitButton Click=@(args => OnClick(args, "SplitButton with text and icon")) Text="SplitButton" Icon="account_circle">
        <ChildContent>
            <RadzenSplitButtonItem Text="Item1" Value="1" Icon="account_box" />
            <RadzenSplitButtonItem Text="Item2" Value="2" Icon="account_balance_wallet" />
        </ChildContent>
    </RadzenSplitButton>
</RadzenStack>

<RadzenText TextStyle="TextStyle.Subtitle1" TagName="TagName.H3" class="rz-mt-4">Images</RadzenText>
<RadzenStack Orientation="Orientation.Horizontal" AlignItems="AlignItems.Center" Gap="1rem" Wrap="FlexWrap.Wrap">
    <RadzenSplitButton Click=@(args => OnClick(args, "SplitButton with image")) Text="Radzen" Image="images/radzen-nuget.png">
        <ChildContent>
            <RadzenSplitButtonItem Text="Item1" Value="1" Icon="account_box" />
            <RadzenSplitButtonItem Text="Item2" Value="2" Icon="account_balance_wallet" />
        </ChildContent>
    </RadzenSplitButton>
</RadzenStack>

@code {
    void OnClick(RadzenSplitButtonItem item, string buttonName)
    {
        if (item != null)
        {
            NotificationService.Notify(new NotificationMessage { Severity = NotificationSeverity.Info, Summary = "SplitButton Item Clicked", Detail = $"{buttonName}, item with value {item.Value} clicked" });
        }
        else
        {
            NotificationService.Notify(new NotificationMessage { Severity = NotificationSeverity.Info, Summary = "SplitButton Clicked", Detail = $"{buttonName} clicked" });
        }
    }
}
