@extends('layouts.public') @section('content') @php use App\Models\Reservation; /** @var array $reservations */ $reservations = $reservations ?? []; $nowTs = time(); @endphp

{{ t_raw('account.my_reservations_title') }}

@php /* The page's messages belong UNDER its title band, inside the page the reader is looking at — not floating above it. getFlashes() consumes, so the layout's own call further out finds nothing and does not draw it twice. */ @endphp
@partial('flash')
@partial('account-nav')

{{ t_raw('account.table_bookings_title') }}

@if (!$reservations)

{{ t_raw('account.no_reservations_empty') }}

{{ t_raw('restaurant.browse') }}
@else
@foreach ($reservations as $r) @php $status = (string) $r['status']; $ts = strtotime((string) $r['reserved_at']); $isFuture = $ts > $nowTs; $canCancel = $isFuture && in_array($status, ['pending', 'confirmed'], true); @endphp @endforeach
{{ t_raw('account.col_when') }}{{ t_raw('common.restaurant') }}{{ t_raw('account.col_party') }}{{ t_raw('common.status') }}{{ t_raw('common.actions') }}
{!! fmt_day($ts) !!}
{!! fmt_clock($ts) !!}
@if (!empty($r['special_requests']))
{{ $r['special_requests'] }}
@endif
{!! restaurant_logo_html(['logo' => $r['restaurant_logo'] ?? '', 'name' => $r['rest_name'] ?? ''], 'sm') !!}
{{ $r['rest_name'] }} @if (!empty($r['label_name'])) {{ $r['label_name'] }} @endif @if (!empty($r['table_label'])){{ t_raw('account.table_label_prefix', [':label' => $r['table_label']]) }}@endif
{{ (int) $r['party_size'] }} {{ Reservation::statusLabel($status) }}
@if ($isFuture && in_array($status, ['pending', 'confirmed', 'seated'], true)) @endif @if ($canCancel)
@csrf
@else {{ t_raw('account.book_again_link') }} @endif
@partial('table-toolbar', ['pager' => $pager, 'base' => '/account/reservations']) @endif
@endsection