@namespace Connected.Components
@inherits UIComponent

<div tabindex="0" @attributes="CustomAttributes" class="@Classname" @onclick="@OnClickHandler">
    @if (!String.IsNullOrEmpty(Avatar))
    {
        <Avatar Class="@AvatarClass" Color="@Color">
            <MudIcon Icon="@Avatar" />
        </Avatar>
    }
    else if (!String.IsNullOrEmpty(Icon) && !IsChecked)
    {
        <Icon Icon="@Icon" Class="chip-icon" Size="Size.Small" Color="@IconColor" />
    }
    else if (IsChecked)
    {
        <Icon Icon="@CheckedIcon" Class="chip-icon" Size="Size.Small" />
    }
    <span class="chip-content">
        @if (ChildContent == null)
        {
            @Text
        }
        else
        {
            @ChildContent
        }
        @if (OnClose.HasDelegate || ChipSet?.AllClosable==true)
        {
            <IconButton Class="chip-close-button" Icon="@(String.IsNullOrEmpty(CloseIcon) ? $"{Icons.Material.Filled.Cancel}" : $"{CloseIcon}")" OnClick="OnCloseHandler" Size="Size.Small"/>
        }
    </span>
</div>
