<?php $__env->startSection('title', 'Messages contact'); ?>

<?php $__env->startSection('content'); ?>
<div class="flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between">
    <h1 class="text-2xl font-semibold text-slate-900">Messages reçus</h1>
    
</div>

<div class="mt-8 overflow-hidden rounded-xl border border-slate-200 bg-white shadow-sm">
    <table class="min-w-full divide-y divide-slate-200 text-sm">
        <thead class="bg-slate-50">
            <tr>
                <th class="px-4 py-3 text-left font-semibold text-slate-700">Date</th>
                <th class="px-4 py-3 text-left font-semibold text-slate-700">Nom</th>
                <th class="px-4 py-3 text-left font-semibold text-slate-700">Téléphone</th>
                <th class="px-4 py-3 text-left font-semibold text-slate-700">Message</th>
                <th class="px-4 py-3 text-right font-semibold text-slate-700"></th>
            </tr>
        </thead>
        <tbody class="divide-y divide-slate-100">
            <?php $__empty_1 = true; $__currentLoopData = $messages; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $msg): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
            <tr class="align-top hover:bg-slate-50/80">
                <td class="whitespace-nowrap px-4 py-3 text-slate-500"><?php echo e($msg->created_at->format('d/m/Y H:i')); ?></td>
                <td class="px-4 py-3 font-medium text-slate-900"><?php echo e($msg->nom_complet); ?></td>
                <td class="whitespace-nowrap px-4 py-3 text-slate-600"><?php echo e($msg->telephone); ?></td>
                <td class="max-w-md px-4 py-3 text-slate-700">
                    <p class="whitespace-pre-wrap break-words"><?php echo e($msg->message); ?></p>
                </td>
                <td class="px-4 py-3 text-right">
                    <form action="<?php echo e(route('admin.messages.destroy', $msg)); ?>" method="post" class="inline" onsubmit="return confirm('Supprimer ce message ?');">
                        <?php echo csrf_field(); ?>
                        <?php echo method_field('DELETE'); ?>
                        <button type="submit" class="text-red-600 hover:text-red-800">Supprimer</button>
                    </form>
                </td>
            </tr>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
            <tr>
                <td colspan="5" class="px-4 py-12 text-center text-slate-500">Aucun message pour le moment.</td>
            </tr>
            <?php endif; ?>
        </tbody>
    </table>
</div>

<?php if($messages->hasPages()): ?>
<div class="mt-6"><?php echo e($messages->links()); ?></div>
<?php endif; ?>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('admin.layout', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\Softsys\akaba_immobilier\resources\views/admin/messages/index.blade.php ENDPATH**/ ?>