<?php require dirname(__DIR__) . '/layouts/app.php'; ?>

<section class="page-heading">
    <div>
        <p class="eyebrow">Reservation #<?= (int) $reservation['id'] ?></p>
        <h1><?= e($reservation['property_title']) ?></h1>
    </div>
    <div class="heading-actions">
        <?php if (Auth::can('reservations.edit')): ?>
            <a class="button-link" href="<?= url('/reservations/edit?id=' . $reservation['id']) ?>">Modifier</a>
        <?php endif; ?>
        <a class="button-link secondary" href="<?= url('/reservations') ?>">Retour</a>
    </div>
</section>

<section class="detail-layout">
    <article class="detail-panel">
        <span class="status-pill reservation-<?= e($reservation['status']) ?>">
            <?= e(reservation_statuses()[$reservation['status']] ?? $reservation['status']) ?>
        </span>
        <dl>
            <dt>Bien</dt>
            <dd><?= e($reservation['property_title']) ?></dd>
            <dt>Localisation</dt>
            <dd><?= e($reservation['city']) ?><?= $reservation['district'] ? ', ' . e($reservation['district']) : '' ?></dd>
            <dt>Client</dt>
            <dd><?= e($reservation['first_name'] . ' ' . $reservation['last_name']) ?></dd>
            <dt>Telephone</dt>
            <dd><?= e($reservation['phone'] ?: '-') ?></dd>
            <dt>Email</dt>
            <dd><?= e($reservation['email'] ?: '-') ?></dd>
            <dt>Dates</dt>
            <dd><?= e($reservation['start_date'] . ' - ' . $reservation['end_date']) ?></dd>
            <dt>Heures</dt>
            <dd><?= e(($reservation['checkin_time'] ?: '-') . ' / ' . ($reservation['checkout_time'] ?: '-')) ?></dd>
            <dt>Montant</dt>
            <dd><?= number_format((float) $reservation['total_amount'], 2, ',', ' ') ?></dd>
        </dl>
    </article>

    <article class="detail-panel">
        <h2>Notes</h2>
        <p><?= nl2br(e($reservation['notes'] ?: 'Aucune note.')) ?></p>
    </article>
</section>

<?php require dirname(__DIR__) . '/layouts/app_footer.php'; ?>
