

<?php $__env->startSection('content'); ?>
    <div class="flex items-center justify-between mb-8">
        <h1 class="text-3xl font-bold">Manajemen Galeri</h1>
        <a href="<?php echo e(route('admin.galleries.create')); ?>"
           class="bg-blue-900 hover:bg-blue-800 text-white px-5 py-3 rounded-xl font-semibold">
            + Tambah Foto
        </a>
    </div>

    <div class="bg-white rounded-2xl shadow p-6 overflow-x-auto">
        <table class="w-full text-left">
            <thead>
                <tr class="border-b">
                    <th class="py-3">Foto</th>
                    <th class="py-3">Judul</th>
                    <th class="py-3">Status</th>
                    <th class="py-3">Tanggal</th>
                    <th class="py-3">Aksi</th>
                </tr>
            </thead>
            <tbody>
                <?php $__empty_1 = true; $__currentLoopData = $galleries; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $gallery): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                    <tr class="border-b align-top">
                        <td class="py-3">
                            <img src="<?php echo e(asset($gallery->image)); ?>" alt="<?php echo e($gallery->title); ?>" class="w-24 h-16 object-cover rounded-lg">
                        </td>
                        <td class="py-3 font-medium"><?php echo e($gallery->title); ?></td>
                        <td class="py-3">
                            <?php if($gallery->is_published): ?>
                                <span class="px-3 py-1 rounded-full bg-green-100 text-green-700 text-sm">Publish</span>
                            <?php else: ?>
                                <span class="px-3 py-1 rounded-full bg-yellow-100 text-yellow-700 text-sm">Draft</span>
                            <?php endif; ?>
                        </td>
                        <td class="py-3"><?php echo e($gallery->created_at->format('d M Y')); ?></td>
                        <td class="py-3">
                            <div class="flex gap-2">
                                <a href="<?php echo e(route('admin.galleries.edit', $gallery)); ?>"
                                   class="bg-amber-500 hover:bg-amber-600 text-white px-4 py-2 rounded-lg text-sm">
                                    Edit
                                </a>

                                <form action="<?php echo e(route('admin.galleries.destroy', $gallery)); ?>" method="POST"
                                      onsubmit="return confirm('Yakin hapus foto ini?')">
                                    <?php echo csrf_field(); ?>
                                    <?php echo method_field('DELETE'); ?>
                                    <button type="submit"
                                            class="bg-red-600 hover:bg-red-700 text-white px-4 py-2 rounded-lg text-sm">
                                        Hapus
                                    </button>
                                </form>
                            </div>
                        </td>
                    </tr>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                    <tr>
                        <td colspan="5" class="py-4 text-slate-500">Belum ada foto galeri.</td>
                    </tr>
                <?php endif; ?>
            </tbody>
        </table>

        <div class="mt-6">
            <?php echo e($galleries->links()); ?>

        </div>
    </div>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('admin.layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /home/kepx5469/public_html/diklat.keperawatanrsbalimeddenpasar.org/resources/views/admin/galleries/index.blade.php ENDPATH**/ ?>