<?php

namespace Src\Sidebar;

use Src\Sidebar\Interfaces\IFactory;
use Src\Sidebar\Interfaces\IModulesProvider;
use Src\Common\Pages\Sidebar\Factory as BaseFactory;
use Src\Common\Pages\Sidebar\Menu;

class Factory extends BaseFactory implements IFactory
{

    protected array $settings = [];

    public function loadSettings(array $settings): void
    {
        $this->settings = $settings;
    }

    public function injectModules(IModulesProvider $provider): void {}

    protected function getMenuConf(): array
    {
        return [
            [
                'title' => 'Настройки',
                'url' => route('admin.jsonObjects.dir', [], false),
            ],
        ];
    }

    public function getMenu(): Menu
    {
        $menu = parent::getMenu();
        $menuData = $this->getMenuConf();
        $menu->load($menuData);
        return $menu;
    }
}
