17 lines
685 B
PHP
17 lines
685 B
PHP
@props(['href', 'active' => false, 'icon' => null, 'count' => null])
|
|
|
|
<a
|
|
href="{{ $href }}"
|
|
@if ($active) aria-current="page" @endif
|
|
{{ $attributes->class('nav-item') }}
|
|
>
|
|
@if ($icon)
|
|
<x-dynamic-component :component="'heroicon-'.($active ? 's' : 'o').'-'.$icon" class="nav-item__icon" />
|
|
@endif
|
|
<span class="nav-item__label" x-data="nameMarquee"><span class="nav-item__label-text" x-ref="inner">{{ $slot }}</span></span>
|
|
{{-- Penghitung hanya diisi dengan angka nyata dari DB; nol tidak ditampilkan --}}
|
|
@if (is_numeric($count) && $count > 0)
|
|
<span class="nav-item__count">{{ $count > 99 ? '99+' : (int) $count }}</span>
|
|
@endif
|
|
</a>
|