@namespace Connected.Components



<div class="@Class">
    @if (!string.IsNullOrWhiteSpace(Text))
    {
        <TextContent Color="@Color" tabindex="-1">@Text</TextContent>
    }
    else if (!string.IsNullOrWhiteSpace(Icon))
    {
        @if (AdornmentClick.HasDelegate)
        {
            <IconButton Icon="@Icon" OnClick="@AdornmentClick" Edge="@Edge" Size="@Size" Color="@Color" aria-label="@(!string.IsNullOrEmpty(AriaLabel) ? AriaLabel : "Icon Button")" tabindex="-1"/>
        }
        else
        {
            <Icon Glyph="@Icon" Size="@Size" Color="@Color" aria-label="@(!string.IsNullOrEmpty(AriaLabel) ? AriaLabel : "Icon")" tabindex="-1"/>
        }
    }
</div>


@code {
    [Parameter] public string Class { get; set; }
    [Parameter] public string Text { get; set; }
    [Parameter] public string Icon { get; set; }
    [Parameter] public Edge Edge { get; set; }
    [Parameter] public Size Size { get; set; } = Size.Medium;
    [Parameter] public ThemeColor Color { get; set; } = ThemeColor.Default;
    [Parameter] public string AriaLabel { get; set; }

    [Parameter] public EventCallback<MouseEventArgs> AdornmentClick { get; set; }
}
