fix(sidebar): menyesuaikan untuk badge

This commit is contained in:
Yoga Pangestu 2025-11-21 15:07:33 +07:00
parent 50f64186c1
commit 6fbc6e4373

View File

@ -19,10 +19,22 @@ class="bg-zinc-50 dark:bg-zinc-900 border-r rtl:border-r-0 rtl:border-l border-z
<div class="text-zinc-500 dark:text-gray-300 text-sm/6">{{ $section['heading'] }}</div>
<div class="grid gap-2">
@foreach ($items as $item)
<flux:navlist.item icon="{{ $item['icon'] }}" href="{{ route($item['route']) }}"
:current="request()->routeIs($item['match'])" wire:navigate.hover>
{{ $item['label'] }}
</flux:navlist.item>
@php
$hasBadge = isset($item['badge']);
@endphp
@if ($hasBadge)
<flux:navlist.item icon="{{ $item['icon'] }}" href="{{ route($item['route']) }}"
:current="request()->routeIs($item['match'])" wire:navigate.hover
badge="{{ $item['badge'] }}">
{{ $item['label'] }}
</flux:navlist.item>
@else
<flux:navlist.item icon="{{ $item['icon'] }}" href="{{ route($item['route']) }}"
:current="request()->routeIs($item['match'])" wire:navigate.hover>
{{ $item['label'] }}
</flux:navlist.item>
@endif
@endforeach
</div>
</div>