@namespace Connected.Components
@inherits SelectItemBase
@using Microsoft.AspNetCore.Components.Routing

<div @attributes="CustomAttributes" class="@Classname" disabled="@Disabled">
    @if (!OnClick.HasDelegate && Command == null)
    {
      <Microsoft.AspNetCore.Components.Routing.NavLink @onclick="@HandleNavigation"
                                                       class="@LinkClassname" 
                 @attributes="@Attributes"
                 Match="@Match" 
                 ActiveClass="@ActiveClass">
            @if (!string.IsNullOrEmpty(Icon))
            {
                <Icon Icon="@Icon" Color="@IconColor" Class="@IconClassname"/>
            }
            <div class="nav-link-text">
                @ChildContent
            </div>
        </Microsoft.AspNetCore.Components.Routing.NavLink>
    }
    else
    {
        <div @onclick="OnClickHandler"
             class="@LinkClassname"
             ActiveClass="@ActiveClass">
            @if (!string.IsNullOrEmpty(Icon))
            {
                <Icon Icon="@Icon" Color="@IconColor" Class="@IconClassname" />
            }
            <div Class="nav-link-text">
                @ChildContent
            </div>
        </div>
    }
</div>