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

<?php $__env->startSection('breadcrumb'); ?>
    <div class="container-fluid px-4">
        <nav aria-label="breadcrumb">
            <ol class="breadcrumb my-0">
                <li class="breadcrumb-item"><a href="<?php echo e(route('admin.dashboard.index')); ?>">Anasayfa</a></li>
                <?php if(isset($navigationPages)): ?>
                    <li class="breadcrumb-item"><a href="<?php echo e(route('admin.navigation.menu.index')); ?>">Navigasyon</a></li>
                    <li class="breadcrumb-item active"><span>Ana Menü</span></li>
                <?php else: ?>
                    <li class="breadcrumb-item active"><span>Navigasyon</span></li>
                <?php endif; ?>
            </ol>
        </nav>
    </div>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>

    <div class="container-lg px-4">

        <?php if(!isset($navigationPages)): ?>
            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('navigation.create')): ?>
                <div class="row mb-4">
                    <div class="d-flex justify-content-end">
                        <a href="<?php echo e(route('admin.navigation.menu.create')); ?>" class="btn btn-sm btn-primary">
                            <span class="cil-plus"></span>
                            Yeni Menü
                        </a>
                    </div>
                </div>
            <?php endif; ?>
        <?php endif; ?>

        <div class="row">
            <div class="col-12">
                <div class="card mb-4">
                    <?php if(isset($navigationPages)): ?>
                        <div class="card-body">
                            <div class="example">
                                <div class="tab-content rounded-bottom">
                                    <div class="tab-pane active preview" role="tabpanel" id="preview-1005">
                                        <table class="table table-hover">
                                            <thead>
                                                <tr>
                                                    <th scope="col">Başlık</th>
                                                    <th scope="col">Slug</th>
                                                    <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check(['page.update'])): ?>
                                                        <th scope="col">İşlem</th>
                                                    <?php endif; ?>
                                                </tr>
                                            </thead>
                                            <tbody>
                                                <?php $__currentLoopData = $navigationPages; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $page): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                    <tr>
                                                        <td>
                                                            <?php echo e($page->title); ?>

                                                        </td>
                                                        <td><?php echo e($page->slug); ?></td>
                                                        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check(['page.update'])): ?>
                                                            <td>
                                                                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('page.update')): ?>
                                                                    <a href="<?php echo e(route('admin.pages.edit', $page->id)); ?>" class="btn btn-sm btn-outline-primary">
                                                                        <span class="cil-pencil"></span>
                                                                    </a>
                                                                <?php endif; ?>
                                                            </td>
                                                        <?php endif; ?>
                                                    </tr>
                                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                            </tbody>
                                        </table>
                                    </div>
                                </div>
                            </div>
                        </div>
                    <?php else: ?>
                        <?php
$__split = function ($name, $params = []) {
    return [$name, $params];
};
[$__name, $__params] = $__split('admin.navigation.menu.index', ['navigationMenu' => $navigationMenu ?? null]);

$__html = app('livewire')->mount($__name, $__params, 'lw-2718075288-0', $__slots ?? [], get_defined_vars());

echo $__html;

unset($__html);
unset($__name);
unset($__params);
unset($__split);
if (isset($__slots)) unset($__slots);
?>
                    <?php endif; ?>
                </div>
            </div>
        </div>
    </div>

<?php $__env->startSection('css'); ?>
    <link href="<?php echo e(URL::to('admin/vendors/@coreui/icons/css/free.min.css')); ?>" rel="stylesheet">

    <style>
        .table > :not(caption) > * > * {
            vertical-align: middle;
        }
    </style>
    <?php echo \Livewire\Mechanisms\FrontendAssets\FrontendAssets::styles(); ?>

<?php $__env->stopSection(); ?>

<?php $__env->startSection('js'); ?>
<?php echo \Livewire\Mechanisms\FrontendAssets\FrontendAssets::scripts(); ?>

<script src="https://cdn.jsdelivr.net/gh/livewire/sortable@v1.x.x/dist/livewire-sortable.js"></script>

    <script>
        const toastConfig = {
            toast: true,
            position: 'top-end',
            showConfirmButton: false,
            timer: 2000,
            timerProgressBar: true,
        };

        document.addEventListener('livewire:init', () => {
            Livewire.on('deleteTriggered', (event) => {
                swal.fire({
                    title: 'Emin misiniz?',
                    text: 'Bu menüye ait tüm linkler silinecektir ve bu işlem geri alınamaz!',
                    icon: 'warning',
                    showCancelButton: true,
                    confirmButtonText: 'Evet, sil!',
                    cancelButtonText: 'Vazgeç'
                }).then((result) => {
                    if (result.isConfirmed) {
                        Livewire.dispatch('delete', {
                            id: event.id
                        });
                    }
                });
            });

            Livewire.on('showAlert', (event) => {
                Swal.fire({
                    ...toastConfig,
                    text: event[0].text,
                    icon: event[0].icon,
                });
            });
        });
    </script>
<?php $__env->stopSection(); ?>

<?php $__env->stopSection(); ?>

<?php echo $__env->make('admin.layout.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /Users/furkanciloglu/Herd/impoholdingpanel/resources/views/admin/navigation/menu/index.blade.php ENDPATH**/ ?>