@using Radzen.Blazor.Rendering
@implements IDisposable
@if ((Tabs?.RenderMode == TabRenderMode.Server ? Visible : true))
{
    <li role="presentation" style=@getStyle() class=@Class
        draggable="@(Tabs?.AllowReorder == true ? "true" : null)"
        @ondragstart="OnDragStart" @ondragover="OnDragOver" @ondragover:preventDefault
        @ondrop="OnDrop" @ondragend="OnDragEnd" @ondragleave="OnDragLeave">
    <button type="button" role="tab" @attributes=@Attributes @onclick=@OnClick
       id="@($"{Tabs?.Id ?? ""}-tabpanel-{Index}-label")"
       aria-selected="@(IsSelected ? "true" : "false")"
       aria-controls="@($"{Tabs?.Id ?? ""}-tabpanel-{Index}")"
       aria-disabled="@(Disabled ? "true" : "false")"
       disabled="@Disabled"
       tabindex="-1"
       @onkeydown:stopPropagation="stopKeydownPropagation" @onkeydown="OnGuardKeyDown">
        @if (!string.IsNullOrEmpty(Icon))
        {
            <span class="notranslate rzi rz-tabview-icon" style="@(!string.IsNullOrEmpty(IconColor) ? $"color:{IconColor}" : null)">@Icon</span>
        }
        @if (Template != null)
        {
            @Template(this)
        }
        else
        {
            <span class="rz-tabview-title">@Text</span>
        }
        </button>
    </li>
}