@props(['active'])

@php
    $classes =
        $active ?? false
            ? 'flex items-center px-4 py-2 rounded-lg bg-purple-100 text-purple-800 font-semibold'
            : 'flex items-center px-4 py-2 rounded-lg text-gray-600 hover:bg-gray-100';
@endphp

@hasrole('Siswa')
    @php
        $classes =
            $active ?? false
                ? 'flex items-center px-4 py-2 rounded-lg bg-fuchsia-900 text-purple-800 font-semibold'
                : 'flex items-center px-4 py-2 rounded-lg text-gray-600 hover:bg-fuchsia-950';
    @endphp
@endhasrole

<a {{ $attributes->merge(['class' => $classes]) }}>
    {{-- Icon slot --}}
    @isset($icon)
        <span class="mr-3 w-5 h-5 text-gray-400">
            {{ $icon }}
        </span>
    @endisset

    <span class="truncate">{{ $slot }}</span>
</a>
