<?php

namespace GriffinForms\Admin\App\Html\Widgets\LeftSidebar;

final class FormEditMenu extends \GriffinForms\Admin\App\Html\Widgets\LeftSidebar\Format
{
    public function getHtml()
    {
        echo '<div id="griffinforms-app-leftsidebar-formeditmenu" class="align-self-start" data-gf-visibility="context" data-gf-context="form-layout">';
        $this->getMenuItemsList();
        echo '</div>';
    }

    private function getMenuItemsList()
    {
        echo '<div class="ms-2">';
        $this->layoutMenuItem();
        $this->nameMenuItem();
        $this->limitsMenuItem();
        $this->accessMenuItem();
        $this->afterSubmitMenuItem();
        $this->submissionsMenuItem();
        echo '</div>';
    }

    private function layoutMenuItem()
    {
        $this->iconMenuItem('space_dashboard', 'layout', __('Layout', 'griffinforms-form-builder'));
    }

    private function nameMenuItem()
    {
        $this->iconMenuItem('page_info', 'name', __('Name', 'griffinforms-form-builder'));
    }

    private function limitsMenuItem()
    {
        $this->iconMenuItem('fence', 'limits', __('Limits', 'griffinforms-form-builder'));
    }

    private function accessMenuItem()
    {
        $this->iconMenuItem('key', 'access', __('Access', 'griffinforms-form-builder'));
    }

    private function afterSubmitMenuItem()
    {
        $this->iconMenuItem('send', 'submitaction', __('Submit Action', 'griffinforms-form-builder'));
    }

    private function submissionsMenuItem()
    {
        $badge = '<span class="ms-2 badge bg-danger">New</span>';
        $this->iconMenuItem('home_storage', 'submissions', __('Submissions', 'griffinforms-form-builder'), $badge);
    }
}