<?php $__env->startSection('title', $potential->exists ? 'Edit Potensi' : 'Tambah Potensi'); ?>
<?php $__env->startSection('page-title', $potential->exists ? 'Edit Potensi Desa' : 'Tambah Potensi Desa'); ?>

<?php $__env->startSection('content'); ?>
<div class="max-w-xl">
    <form method="POST" action="<?php echo e($potential->exists ? route('admin.potensi.update', $potential->id) : route('admin.potensi.store')); ?>" enctype="multipart/form-data" class="card-admin space-y-4">
        <?php echo csrf_field(); ?>
        <?php if($potential->exists): ?> <?php echo method_field('PUT'); ?> <?php endif; ?>

        <div>
            <label class="form-label">Kategori *</label>
            <select name="kategori" class="form-select" required>
                <option value="">Pilih Kategori</option>
                <?php $__currentLoopData = ['pertanian' => 'Pertanian', 'perkebunan' => 'Perkebunan', 'umkm' => 'UMKM', 'pariwisata' => 'Pariwisata', 'peternakan' => 'Peternakan']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $val => $lbl): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <option value="<?php echo e($val); ?>" <?php echo e(old('kategori', $potential->kategori) === $val ? 'selected' : ''); ?>><?php echo e($lbl); ?></option>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </select>
        </div>

        <div><label class="form-label">Nama *</label><input name="nama" value="<?php echo e(old('nama', $potential->nama)); ?>" class="form-input" required></div>
        <div><label class="form-label">Deskripsi *</label><textarea name="deskripsi" rows="4" class="form-textarea" required><?php echo e(old('deskripsi', $potential->deskripsi)); ?></textarea></div>
        <div><label class="form-label">Lokasi</label><input name="lokasi" value="<?php echo e(old('lokasi', $potential->lokasi)); ?>" class="form-input" placeholder="Dusun I, Desa Suka Baru"></div>
        <div>
            <label class="form-label">Foto</label>
            <?php if($potential->foto_url): ?><img src="<?php echo e($potential->foto_url); ?>" class="w-full h-32 object-cover rounded-lg mb-2"><?php endif; ?>
            <input type="file" name="foto" accept="image/*" class="form-input">
            <p class="text-xs text-gray-400 mt-1">JPG/PNG/WebP, maks 2MB</p>
        </div>

        <?php if($errors->any()): ?>
            <div class="bg-red-50 border border-red-200 rounded-lg p-3">
                <?php $__currentLoopData = $errors->all(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $e): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><p class="text-red-600 text-sm"><?php echo e($e); ?></p><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </div>
        <?php endif; ?>

        <div class="flex gap-3 pt-2">
            <button type="submit" class="btn-primary">💾 <?php echo e($potential->exists ? 'Perbarui' : 'Simpan'); ?></button>
            <a href="<?php echo e(route('admin.potensi.index')); ?>" class="btn-secondary">Batal</a>
        </div>
    </form>
</div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.admin', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH F:\web Desa Suka Baru\website-desa-suka-baru\resources\views/admin/potentials/form.blade.php ENDPATH**/ ?>