clusev/resources/views/components/nav-item.blade.php

16 lines
897 B
PHP

@props(['icon', 'href' => '#', 'active' => false, 'badge' => null])
<a href="{{ $href }}"
@class([
'group flex min-h-11 items-center gap-3 rounded-md border px-3 py-2 text-sm transition-colors',
'border-accent/25 bg-accent/10 text-ink shadow-[inset_2px_0_0_var(--color-accent)]' => $active,
'border-transparent text-ink-2 hover:bg-raised hover:text-ink' => ! $active,
])
@if ($active) aria-current="page" @endif>
<x-icon :name="$icon" @class(['h-[18px] w-[18px] shrink-0', 'text-accent' => $active]) />
<span class="truncate">{{ $slot }}</span>
@if ($badge !== null && $badge !== '')
<span class="ml-auto inline-flex h-4 min-w-4 shrink-0 items-center justify-center rounded-full bg-accent px-1 font-mono text-[10px] font-semibold tabular-nums text-void"
title="{{ __('shell.update_available') }}">{{ $badge }}</span>
@endif
</a>