@props(['title', 'description', 'icon', 'iconBg' => 'bg-primary', 'url' => null, 'onclick' => null])

@php
    $tag = $url ? 'a' : 'div';
    $attributes = $url ? ['href' => $url, 'class' => 'shortcut-item'] : ['class' => 'shortcut-item'];
    if ($onclick) {
        $attributes['onclick'] = $onclick;
    }
@endphp

<{{ $tag }} @foreach($attributes as $key => $value) {{ $key }}="{{ $value }}" @endforeach>
    <div class="shortcut-icon {{ $iconBg }}">
        <i class="{{ $icon }}"></i>
    </div>
    <div class="shortcut-content">
        <h4>{{ __($title) }}</h4>
        <p class="text-muted small mb-0">{{ __($description) }}</p>
    </div>
    <i class="fa-solid fa-chevron-right shortcut-arrow"></i>
</{{ $tag }}>

