

<?php $__env->startSection('content'); ?>
<div class="flex justify-between items-center mb-8">
    <div>
        <h1 class="text-3xl font-black">Kelola Event Saya</h1>
        <p class="text-slate-500 font-medium">Daftar event yang Anda selenggarakan</p>
    </div>
    <a href="<?php echo e(route('partner.events.create')); ?>"
        class="px-6 py-3 bg-emerald-600 text-white rounded-xl font-bold hover:bg-emerald-700 transition shadow-lg flex items-center gap-2">
        <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4v16m8-8H4"></path>
        </svg>
        Buat Event Baru
    </a>
</div>

<div class="bg-white rounded-3xl border border-slate-100 shadow-sm overflow-hidden">
    <div class="overflow-x-auto">
        <table class="w-full text-left border-collapse">
            <thead class="bg-slate-50 text-slate-400 uppercase text-[10px] font-black tracking-widest">
                <tr>
                    <th class="px-8 py-4">Event</th>
                    <th class="px-8 py-4">Kategori</th>
                    <th class="px-8 py-4">Tanggal</th>
                    <th class="px-8 py-4">Harga</th>
                    <th class="px-8 py-4">Stok</th>
                    <th class="px-8 py-4 text-right">Aksi</th>
                </tr>
            </thead>
            <tbody class="divide-y border-t">
                <?php $__empty_1 = true; $__currentLoopData = $events; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $event): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                <tr class="hover:bg-slate-50 transition">
                    <td class="px-8 py-6">
                        <p class="font-bold"><?php echo e($event->title); ?></p>
                        <p class="text-xs text-slate-400"><?php echo e(Str::limit($event->description, 50)); ?></p>
                    </td>
                    <td class="px-8 py-6">
                        <span class="px-3 py-1 bg-indigo-100 text-indigo-700 rounded-lg text-xs font-bold">
                            <?php echo e($event->category?->name ?? '-'); ?>

                        </span>
                    </td>
                    <td class="px-8 py-6 text-sm text-slate-600">
                        <?php echo e(\Carbon\Carbon::parse($event->date)->format('d M Y - H:i')); ?>

                    </td>
                    <td class="px-8 py-6 font-bold">Rp <?php echo e(number_format($event->price, 0, ',', '.')); ?></td>
                    <td class="px-8 py-6"><?php echo e($event->stock); ?></td>
                    <td class="px-8 py-6 text-right">
                        <div class="flex justify-end gap-2">
                            <a href="<?php echo e(route('partner.events.edit', $event->id)); ?>"
                                class="px-4 py-2 bg-indigo-50 text-indigo-600 rounded-xl text-xs font-bold hover:bg-indigo-100 transition">
                                Edit
                            </a>
                            <a href="<?php echo e(route('events.show', $event->id)); ?>" target="_blank"
                                class="px-4 py-2 bg-emerald-50 text-emerald-600 rounded-xl text-xs font-bold hover:bg-emerald-100 transition">
                                Lihat
                            </a>
                            <form method="POST" action="<?php echo e(route('partner.events.destroy', $event->id)); ?>" onsubmit="return confirm('Hapus event ini?')">
                                <?php echo csrf_field(); ?>
                                <?php echo method_field('DELETE'); ?>
                                <button type="submit"
                                    class="px-4 py-2 bg-rose-50 text-rose-600 rounded-xl text-xs font-bold hover:bg-rose-100 transition">
                                    Hapus
                                </button>
                            </form>
                        </div>
                    </td>
                </tr>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                <tr>
                    <td colspan="6" class="px-8 py-16 text-center">
                        <p class="text-slate-400 text-lg font-medium">Belum ada event</p>
                        <p class="text-slate-300 text-sm mt-1">Buat event pertama Anda sekarang!</p>
                    </td>
                </tr>
                <?php endif; ?>
            </tbody>
        </table>
    </div>
</div>
<?php $__env->stopSection(); ?>


<?php echo $__env->make('partner.layouts.partner', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\laragon\www\Eventamikom-3182\resources\views/partner/events/index.blade.php ENDPATH**/ ?>