<div class="card border shadow-sm w-100 mb-3">
    <div class="card-body py-3 px-3">
        <div class="table-responsive mb-3">
            <table class="table table-sm mb-0 align-middle">
                <tbody>
                    <tr>
                        <th class="text-muted w-25">Codice</th>
                        <td class="fw-semibold text-primary fs-5">{{ $pre_ordine->codice ?? '-' }}</td>
                    </tr>
                    <tr>
                        <th class="text-muted">Totale</th>
                        <td class="fw-semibold text-primary fs-5">&euro; {{ number_format($pre_ordine->prezzo ?? 0, 2, ',', '.') }}</td>
                    </tr>
                    <tr>
                        <th class="text-muted">Info</th>
                        <td>
                            @if(!empty($pre_ordine->info) && is_array($pre_ordine->info))
                                <ul class="mb-0 ps-3" style="list-style:disc;">
                                    @foreach(collect($pre_ordine->info)->sortKeys() as $k => $v)
                                        <li><strong>{{ ucwords(str_replace('_', ' ', $k)) }}:</strong> {{ $v }}</li>
                                    @endforeach
                               
                                </ul>
                            @else
                                -
                            @endif
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
        <div class="d-flex justify-content-end">
            <button type="button" @if($pre_ordine->stato == \App\Models\SaltacodaOrdine::IMPORTATO) disabled @endif class="btn btn-primary btn-sm" id="btn-importa-preordine" onclick="importaPreOrdine('{{ $pre_ordine->codice }}')">
                <i class="bx bx-download me-1"></i>
                @if($pre_ordine->stato == \App\Models\SaltacodaOrdine::IMPORTATO)
                    Importato
                @else
                    Importa
                @endif
            </button>
        </div>
    </div>
</div>
