<?php

namespace GriffinForms\Admin\App\Html\Modals\DialogueBoxes;

class Format extends \GriffinForms\Admin\App\Html\Modals\Format
{
    public function getHtml()
    {
        echo '<div class="modal fade" id="' . esc_attr($this->getHtmlId('modal')) . '" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">';
        echo '<div class="modal-dialog modal-dialog-centered modal-sm">';
        echo '<div class="modal-content">';

        $this->modalHeader();
        $this->modalBody();
        $this->modalFooter();

        echo '</div>';
        echo '</div>';
        echo '</div>';
    }

    protected function modalHeader()
    {
        echo '<div class="modal-header border-0">';
        echo '<div class="modal-title fs-5" id="' . esc_attr($this->getHtmlId('modal-title')) . '">';
        $this->modalTitle();
        echo '</div>';
        echo '<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>';
        echo '</div>';
    }

    protected function modalTitle()
    {

    }

    protected function modalBody()
    {
        echo '<div class="modal-body">';
        $this->modalBodyContent();
        echo '</div>';
    }

    protected function modalBodyContent()
    {

    }

    protected function modalFooter()
    {
        echo '<div class="modal-footer border-0">';
        $this->secondaryBtn();
        $this->actionBtn();
        echo '</div>';
    }

    protected function secondaryBtn()
    {
        $this->buttons->bsBtn([
            'class' => 'w-100 gf-btn-sm gf-btn-outline',
            'id'    => $this->getHtmlId('modal-secondary-btn'),
            'label' => __('Close', 'griffinforms-form-builder'),
            'data'  => [
                'data-bs-dismiss=modal',
                'data-bs-target=#' . $this->getHtmlId('modal')
            ]
        ]);
    }

    public function getJs()
    {
        $this->getModalJs();   
    }
}