@namespace Connected.Components
@inherits UIComponent

<div tabindex="0" @attributes="CustomAttributes" class="@Classname" @onclick="OnClickHandler" @onclick:stopPropagation="true">
    @if (!string.IsNullOrWhiteSpace(Avatar))
    {
        <div class="list-item-avatar">
            <Avatar Class="@AvatarClass">
                <Icon Icon="@Avatar" Color="@IconColor" Size="@IconSize" />
            </Avatar>
        </div>
    }
    else if (!string.IsNullOrWhiteSpace(Icon))
    {
        <div class="list-item-icon">
            <Icon Icon="@Icon" Color="@IconColor" Size="@IconSize" />
        </div>
    }
    <div class="list-item-text @(Inset? "list-item-text-inset" : "")">
        <Text Typo="@_textTypo">
            @if (ChildContent != null)
            {
                @ChildContent
            }
            else
            {
                @Text
            }
        </Text>
    </div>
    @if (NestedList != null)
    {
        <Icon Icon="@($"{(_expanded ? ExpandLessIcon : ExpandMoreIcon)}")" Size="@IconSize" Color="@AdornmentColor" />
    }
</div>
@if (NestedList != null)
{
    <Collapse Expanded="@Expanded">
        <List Clickable="List?.Clickable ?? false" Color="List?.Color ?? ThemeColor.Primary" DisablePadding="true" Class="nested-list" Disabled="@Disabled" Dense="(Dense ??  List?.Dense) ?? false">
            @NestedList
        </List>
    </Collapse>
}