<?php
use Illuminate\Support\Facades\Auth;
?>

<div class="dropdown">
    <button type="button" class="btn p-0 dropdown-toggle hide-arrow" data-bs-toggle="dropdown" aria-expanded="false">
        <i class="bx bx-dots-vertical-rounded fs-large"></i>
    </button>
    <div class="dropdown-menu">
    @if(Auth::user()->can('view-ordine'))
    <a href="{{ route('ordine.show', ['ordine_id' => $entity->id]) }}" class="dropdown-item ">
            <i class="bx bx-show me-1"></i> Vedi ordine
        </a>
    @endif
    @if(isset($entity->prenotazione))
    <a href="#" class="dropdown-item " onclick='showModalPrenotazione("{{ $entity->prenotazione->id }}");'>
            <i class="bx bx-calendar-check me-1"></i> Vedi prenotazione
        </a>
    @endif
    @if(isset($entity->pagamento))
    <a href="#" class="dropdown-item " onclick='showModalPagamento("{{ $entity->pagamento->id }}");'>
            <i class="bx bx-money me-1"></i> Vedi pagamento
        </a>
    @endif

        @if(Auth::user()->can('edit-ordine'))
        <a href="#" class="dropdown-item editor_edit">
            <i class="bx bx-edit-alt me-1"></i> Modifica
        </a>
        @endif
       
        @if(Auth::user()->can('delete-ordine'))
        <a href="#" class="dropdown-item editor_delete">
            <i class="bx bx-trash me-1"></i> Elimina
        </a>
        @endif
    </div>
</div>
