@props(['icon' => null, 'href' => null, 'danger' => false, 'disabled' => false])
@php
$tone = $danger
? 'text-red-600 hover:bg-red-50 dark:text-red-400 dark:hover:bg-red-500/10'
: 'text-slate-700 hover:bg-slate-100 dark:text-slate-200 dark:hover:bg-slate-700/60';
$classes = "flex w-full items-center gap-2.5 rounded-lg px-3 py-2 text-left text-sm font-medium transition {$tone}";
@endphp
@if ($disabled)
{{-- Shown but visibly unavailable, rather than hidden: a menu whose contents
change per row is harder to learn than one where the same items are
always in the same place. --}}
@if ($icon)@endif
{{ $slot }}
@elseif ($href)
merge(['class' => $classes]) }}>
@if ($icon)@endif
{{ $slot }}
@else
{{-- type is merged rather than hard-coded: most items are the submit button
of a small POST form, but a menu item that only runs an Alpine handler
has to be able to say type="button" or it submits whatever form it
happens to be sitting inside. --}}
@endif