<div>
    <div class="row">
        <div class="col-lg-4">
            <form wire:submit.prevent="<?php echo e($aksi); ?>">
                <div class="card">
                    <div class="card-body">
                        <div class="mb-3">
                            <label for="judul" class="form-label">Judul Album <span class="text-danger">*</span></label>
                            <input type="text" name="judul" id="judul" wire:model="judul" class="form-control">
                            <!--[if BLOCK]><![endif]--><?php $__errorArgs = ['judul'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                <div class="text-danger error-validation">
                                    <?php echo e($message); ?>

                                </div>
                            <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?> <!--[if ENDBLOCK]><![endif]-->
                        </div>
                        <div class="mb-3">
                            <label for="tanggalPublish" class="form-label">Tanggal Kegiatan <span
                                    class="text-danger">*</span></label>
                            <input type="text" name="tanggalPublish" id="tanggalPublish" wire:model="tanggalPublish"
                                class="form-control">
                            <!--[if BLOCK]><![endif]--><?php $__errorArgs = ['tanggalPublish'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                <div class="text-danger error-validation">
                                    <?php echo e($message); ?>

                                </div>
                            <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?> <!--[if ENDBLOCK]><![endif]-->
                        </div>
                        <div class="mb-3">
                            <label class="form-label" for="statusPublish">Status <span
                                    class="text-danger">*</span></label>
                            <div wire:ignore>
                                <select class="form-control" id="statusPublish" name="statusPublish"
                                    wire:model="statusPublish">
                                    <option value=""></option>
                                    <option value="1">Aktif</option>
                                    <option value="0">Tidak Aktif</option>
                                </select>
                            </div>
                            <!--[if BLOCK]><![endif]--><?php $__errorArgs = ['statusPublish'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                <div class="text-danger error-validation">
                                    <?php echo e($message); ?>

                                </div>
                            <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?> <!--[if ENDBLOCK]><![endif]-->
                        </div>
                        <div class="mb-0">
                            <label for="deskripsi" class="form-label">Deskripsi</label>
                            <textarea name="deskripsi" id="deskripsi" rows="6" class="form-control" wire:model="deskripsi"
                                style="resize: none"></textarea>
                            <!--[if BLOCK]><![endif]--><?php $__errorArgs = ['deskripsi'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                <div class="text-danger error-validation">
                                    <?php echo e($message); ?>

                                </div>
                            <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?> <!--[if ENDBLOCK]><![endif]-->
                        </div>
                    </div>
                    <div class="card-footer">
                        <div class="d-flex">
                            <div wire:loading.remove wire:target="reset_fields">
                                <button type="button" wire:click="reset_fields"
                                    class="btn btn-danger me-2">Reset</button>
                            </div>
                            <div wire:loading wire:target="reset_fields">
                                <button class="btn btn-danger me-2" type="button" disabled="">Loading..
                                </button>
                            </div>
                            <div wire:loading.remove wire:target="<?php echo e($aksi); ?>">
                                <button type="submit" class="btn btn-success me-2">Simpan</button>
                            </div>
                            <div wire:loading wire:target="<?php echo e($aksi); ?>">
                                <button class="btn btn-success me-2" type="button" disabled="">Loading..
                                </button>
                            </div>
                        </div>
                    </div>
                </div>
            </form>
        </div>
        <div class="col-lg-8">
            <div class="card mb-2">
                <div class="card-body p-0">
                    <div class="table-responsive">
                        <table class="table table-striped-columns mb-0 text-center align-middle">
                            <thead class="table-light">
                                <tr>
                                    <th width="50%">Judul</th>
                                    <th>Deskripsi</th>
                                    <th width="5%">#</th>
                                </tr>
                            </thead>
                            <tbody>
                                <!--[if BLOCK]><![endif]--><?php $__empty_1 = true; $__currentLoopData = $data; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $i => $res): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                                    <tr>
                                        <td>
                                            <div class="d-flex align-items-center">
                                                <div class="flex-shrink-0">
                                                    <a href="<?php echo e(route('admin.foto-kegiatan', ['id' => $res->id])); ?>"
                                                        class="text-white">
                                                        <div class="avatar-xs">
                                                            <div class="avatar-title rounded">
                                                                <i class="ri-folder-2-fill align-bottom fs-17"></i>
                                                            </div>
                                                        </div>
                                                    </a>
                                                </div>
                                                <div class="flex-grow-1 ms-3">
                                                    <h5 class="mb-1 fs-6"><?php echo e($res->judul); ?></h5>
                                                    <p class="mb-0 fs-12 text-muted">
                                                        <?php echo e(tanggal_indo($res->tanggal_publish)); ?></p>
                                                </div>
                                            </div>
                                        </td>
                                        <td><?php echo e($res->deskripsi ?? '-'); ?></td>
                                        <td>
                                            <div wire:key="album-kegiatan_<?php echo e($res->id); ?>">
                                                <div class="btn-group">
                                                    <button class="btn btn-primary btn-sm dropdown-toggle"
                                                        type="button" data-bs-toggle="dropdown" aria-haspopup="true"
                                                        aria-expanded="false">
                                                        Aksi
                                                    </button>
                                                    <div class="dropdown-menu">
                                                        <a class="dropdown-item"
                                                            href="<?php echo e(route('admin.foto-kegiatan', ['id' => $res->id])); ?>"
                                                            wire:click="edit(<?php echo e($res->id); ?>)">Tambah Foto</a>
                                                        <a class="dropdown-item" href="javascript:void(0)"
                                                            wire:click="edit(<?php echo e($res->id); ?>)">Edit</a>
                                                        <a class="dropdown-item" href="javascript:void(0)"
                                                            wire:click="confirm(<?php echo e($res->id); ?>)">Hapus</a>
                                                    </div>
                                                </div>
                                            </div>
                                        </td>
                                    </tr>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                                    <tr>
                                        <td colspan="3"><strong>No Data</strong></td>
                                    </tr>
                                <?php endif; ?> <!--[if ENDBLOCK]><![endif]-->
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
            <!--[if BLOCK]><![endif]--><?php if($data->isNotEmpty()): ?>
                <div class="py-2">
                    <?php echo e($data->links()); ?>

                </div>
            <?php endif; ?> <!--[if ENDBLOCK]><![endif]-->
        </div>
    </div>
</div>
<?php $__env->startPush('plugin-style'); ?>
    <link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" />
<?php $__env->stopPush(); ?>
<?php $__env->startPush('script'); ?>
    <script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script>
    <script src="<?php echo e(asset('build/libs/flatpickr/flatpickr.min.js')); ?>"></script>
    <script src="https://npmcdn.com/flatpickr@4.6.13/dist/l10n/id.js"></script>
    <script>
        $(window).on('load', function() {
            init_create();
        });

        Livewire.hook('commit', ({
            component,
            commit,
            respond,
            succeed,
            fail
        }) => {
            succeed(({
                snapshot,
                effect
            }) => {
                queueMicrotask(() => {
                    init_create();
                })
            })

            fail(() => {

            })
        })


        function init_create() {
            $('#tanggalPublish').flatpickr({
                locale: "id",
                disableMobile: "true",
                onChange: function(date, datestr) {
                    window.Livewire.find('<?php echo e($_instance->getId()); ?>').set('tanggalPublish', datestr);
                }
            });

            $('#statusPublish').select2({
                placeholder: "Pilih .."
            }).on('select2:select', function(e) {
                window.Livewire.find('<?php echo e($_instance->getId()); ?>').set("statusPublish", e.target.value);
            });
        }
    </script>
<?php $__env->stopPush(); ?>
<?php /**PATH /Users/aptika/Workspace/webprofilev2/resources/views/livewire/album-kegiatan.blade.php ENDPATH**/ ?>