@props([
'icon' => null,
'eicon' => null,
'label' => null,
'route' => null,
'url' => null,
'href' => null,
'click' => null,
'confirm' => false,
])
@php
if ($route) $href = route($route);
else if ($url) $href = url($url);
$attributes = $attributes->class([
'dropdown-item',
'active' => $href == Request::url(),
])->merge([
'type' => !$href ? 'button' : null,
'href' => $href,
'wire:click' => $click,
'onclick' => $confirm ? 'confirm("Êtes vous sûr(e) de vouloir ' . (is_string($confirm) ? $confirm : 'effectuer cette action') . '?") || event.stopImmediatePropagation()' : null,
]);
@endphp
<{{ $href ? 'a' : 'button' }} {{ $attributes }}>
{{ $label ?? $slot }}
{{ $href ? 'a' : 'button' }}>