<?php
    /**
     * @var AppView $this
     */

    use App\View\AppView;

    if ($this->PageActions->get('bottom-left')) {
        $this->append('footer-left');
        echo $this->PageActions->render('bottom-left');
        $this->end();
    }
    if ($this->PageActions->get('bottom-right')) {
        $this->append('footer-right');
        echo $this->PageActions->render('bottom-right');
        $this->end();
    }
?>

<div class="modal-content">
    <div class="modal-header border-bottom py-5 align-items-start">
        <div>
            <h1 class="modal-title fs-3 mb-1"><?= $this->fetch('title') ?></h1>
           <?php /*= $this->element('Icing.theme/breadcrumbs') */?>

        </div>
        <div class="text-nowrap">
            <?php if ($actions = $this->PageActions->render('top-right', 'default')): ?>
                <button
                    type="button"
                    class="btn btn-outline-dark px-3 border-0"
                    aria-label="Menu"
                    data-bs-toggle="dropdown"
                    aria-expanded="false"
                >
                    <i class="fa-solid fa-bars fa-lg fa-fw "></i>
                </button>
                <ul
                    class="dropdown-menu dropdown-menu-end"
                    style="width: max-content; max-width: 90vw;"
                >
                    <li class="d-flex flex-column mw-100 w-100 !px-3 !gap-2">
                        <?php
                            $actions = str_replace('btn ', 'dropdown-item ', $actions);
                            $actions = str_replace('btn-', 'dropdown-item-', $actions);
                            echo $actions;
                        ?>
                    </li>
                </ul>
            <?php endif ?>
            <button
                type="button"
                class="btn btn-outline-dark px-3 border-0"
                data-bs-dismiss="modal"
                aria-label="Close"
            >
                <i class="fa fa-times fa-fw fa-lg"></i>
            </button>
        </div>

    </div>
    <div class="modal-body bg-body p-3 p-sm-6">
        <?= $this->fetch('content') ?>
    </div>
    <div class="modal-footer py-4 row justify-content-between">
        <div class="col-auto">
            <?= $this->fetch('footer-left') ?>
        </div>
        <div class="col-auto">
            <?= $this->fetch('footer-right') ?>
        </div>
    </div>
</div>

<?= $this->fetch('scripts') ?>
<?= $this->fetch('postLink') ?>
