<?php

namespace App\Controller\Admin;


use App\Entity\Common\TaxRate;
use App\Entity\Site\Page;
use App\Entity\User\GroupUser;
use App\Entity\User\User;
use EasyCorp\Bundle\EasyAdminBundle\Config\Assets;
use EasyCorp\Bundle\EasyAdminBundle\Config\Crud;
use EasyCorp\Bundle\EasyAdminBundle\Config\MenuItem;
use Lc\SovBundle\Controller\Admin\DashboardController as LcDashboardController;

class DashboardController extends LcDashboardController
{

    public function configureMenuItems(): iterable
    {
        yield MenuItem::linkToDashboard('Tableau de bord', 'circle');

        yield MenuItem::subMenu('Utilisateurs', 'user')->setSubItems(
                [
                        MenuItem::linkToCrud('Utilisateurs', '', User::class),
                        MenuItem::linkToCrud('Groupes d\'utilisateurs', '', GroupUser::class),
                ]
        );

        yield MenuItem::linkToCrud('Pages', 'copy', Page::class);
        yield MenuItem::linkToCrud('TVA', 'circle', TaxRate::class);

        yield MenuItem::subMenu('Mon compte', 'user')->setSubItems(
                [
                        MenuItem::linkToRoute('Informations personnelles', '', 'sov_admin_account_profile'),
                        MenuItem::linkToRoute('Mot de passe', '', 'sov_admin_account_password'),
                ]
        );

        /*
         MenuItem::section('Blog'),
         MenuItem::linkToCrud('Categories', 'fa fa-tags', Category::class),
         MenuItem::linkToCrud('Blog Posts', 'fa fa-file-text', BlogPost::class),

         MenuItem::section('Users'),
         MenuItem::linkToCrud('Comments', 'fa fa-comment', Comment::class),
         MenuItem::linkToCrud('Users', 'fa fa-user', User::class),*/
    }

    /*public function configureMenuItems(): iterable
    {
        $submenu1 = [
                MenuItem::linkToCrud('Zones', 'fas fa-map-marked-alt', DeliveryAvailabilityZone::class),
                MenuItem::linkToCrud('Ambassades', 'fas fa-store-alt', DeliveryAvailabilityZone::class),
        ];

        $submenu2 = [
                MenuItem::linkToCrud('Produits', 'fas fa-carrot', ProductFamily::class),
                MenuItem::linkToCrud('Produits (édition avancée)', 'fas fa-carrot', ProductFamily::class),
                MenuItem::linkToCrud('Renouvelement des stocks', 'fas fa-layer-group', ProductFamily::class),
                MenuItem::linkToCrud('Catégories', 'fas fa-store', ProductCategory::class)->setPermission('ROLE_ADMIN'),
                MenuItem::linkToCrud('Producteurs', 'fas fa-tractor', Supplier::class)->setPermission('ROLE_ADMIN'),
                MenuItem::linkToCrud('Zones de dépôt', 'fas fa-cubes', DepositoryZone::class)->setPermission('ROLE_ADMIN'),
        ];

        $submenu3 = [
                MenuItem::linkToCrud('Paniers', 'fas fa-shopping-basket', OrderShop::class),
                MenuItem::linkToCrud('Commandes ', 'fas fa-shopping-cart', OrderShop::class),
                MenuItem::linkToCrud('Relivraisons', 'fas fa-undo', OrderProduct::class),
        ];

        $submenu4 = [
                MenuItem::linkToCrud('Commandes du jour', 'fas fa-calendar-day', OrderShop::class),
                MenuItem::linkToCrud('Toutes les commandes', 'fas fa-utensils', OrderShop::class),
        ];

        $submenu5 = [
                MenuItem::linkToCrud('Utilisateurs', 'fas fa-user', User::class),
                MenuItem::linkToCrud('Groupes d\'utilisateurs', 'fas fa-users', GroupUser::class),
                MenuItem::linkToCrud('Comptes prépayés', 'fas fa-cash-register', UserMerchant::class),
                MenuItem::linkToCrud('Parrainages', 'fas fa-user-plus', Sponsor::class),
        ];

        $submenu6 = [
                MenuItem::linkToCrud('Réductions sur catalogues', 'fas fa-book', ReductionCatalog::class),
                MenuItem::linkToCrud('Réductions paniers', 'fas fa-shopping-basket', ReductionCart::class),
                MenuItem::linkToCrud('Avoirs', 'fas fa-backspace', ReductionCredit::class),
                MenuItem::linkToCrud('Bons cadeaux', 'fas fa-gift', ReductionCredit::class),
        ];

        $submenu7 = [
                MenuItem::linkToCrud('Zones', 'fas fa-map-marked-alt', DeliveryZone::class),
                MenuItem::linkToCrud('Ambassades', 'fas fa-map-marker-alt', PointSale::class),
                MenuItem::linkToCrud('Créneaux horaires', 'fas fa-clock', DeliverySlot::class),
                MenuItem::linkToCrud('Tarifs', 'fas fa-euro-sign', DeliveryPrice::class),
                MenuItem::linkToCrud('Dispo zones (par défaut)', 'fas fa-calendar-check', DeliveryAvailabilityZone::class),
                MenuItem::linkToCrud('Dispo ambassades  (par défaut)', 'fas fa-calendar-check', DeliveryAvailabilityZone::class),
                MenuItem::linktoRoute('Livraison à vélo', 'fas fa-bicycle', 'admin_bike_delivery'),
        ];

        $submenu8 = [
                MenuItem::linkToCrud('Bons de commandes', 'fas fa-tractor', Supplier::class),
                MenuItem::linktoRoute('Exports', 'fas fa-download', 'admin_exports'),
                MenuItem::linktoRoute('Pesées', 'fas fa-truck-loading', 'admin_export_weighing'),
                MenuItem::linkToCrud('Comptabilité', 'fas fa-euro-sign', OrderShop::class),
        ];

        $submenu9 = [
                MenuItem::linkToCrud('Notifications activées', 'fas fa-check', NotificationUser::class),
                MenuItem::linkToCrud('Notifications envoyées', 'fas fa-archive', NotificationLog::class),
        ];

        yield MenuItem::linktoRoute('Tableau de bord', 'fas fa-tachometer-alt', 'admin_dashboard', ['count_menu_item' => 'productAvailabilitiesNegative', 'alert' => 1]);
        yield MenuItem::linkToCrud('Tickets', 'fas fa-envelope', Ticket::class)->setPermission('ROLE_ADMIN');
        yield MenuItem::subMenu('Disponibilités', 'fas fa-calendar-check')->setSubItems($submenu1)->setPermission('ROLE_ADMIN');
        yield MenuItem::subMenu('Catalogues', 'fas fa-book')->setSubItems($submenu2);
        yield MenuItem::subMenu('Commandes marché', 'fas fa-shopping-cart')->setSubItems($submenu3)->setPermission('ROLE_ADMIN');
        yield MenuItem::subMenu('Commandes du midi', 'fas fa-utensils')->setSubItems($submenu4);
        yield MenuItem::subMenu('Utilisateurs', 'fas fa-users')->setSubItems($submenu5)->setPermission('ROLE_ADMIN');
        yield MenuItem::subMenu('Reductions', 'fas fa-tags')->setSubItems($submenu6)->setPermission('ROLE_ADMIN');
        yield MenuItem::subMenu('Livraisons', 'fas fa-truck')->setSubItems($submenu7)->setPermission('ROLE_ADMIN');
        yield MenuItem::subMenu('Exports', 'fas fa-file-export')->setSubItems($submenu8)->setPermission('ROLE_ADMIN');
        yield MenuItem::linkToCrud('Pense bêtes', 'fas fa-thumbtack', Reminder::class)->setPermission('ROLE_ADMIN');
        yield MenuItem::linkToCrud('Actualités', 'fas fa-bullhorn', News::class)->setPermission('ROLE_ADMIN');
        yield MenuItem::subMenu('Notifications', 'fas fa-bell')->setSubItems($submenu9)->setPermission('ROLE_ADMIN');
        yield MenuItem::linkToCrud('Pages', 'fas fa-file', Page::class)->setPermission('ROLE_ADMIN');
        yield MenuItem::linkToCrud('Paramètres', 'fas fa-cogs', Hub::class)->setPermission('ROLE_SUPER_ADMIN');
        yield MenuItem::linktoRoute('Statistiques', 'fas fa-chart-line', 'admin_statistic')->setPermission('ROLE_SUPER_ADMIN');
        yield MenuItem::linktoRoute('Espace développement', 'fas fa-drafting-compass', 'admin_develop')->setPermission('ROLE_SUPER_ADMIN');

        yield MenuItem::section('Administration', 'fas fa-folder-open')->setPermission('ROLE_SUPER_ADMIN');
        yield MenuItem::linkToCrud('Hubs', 'fas fa-store', Hub::class)->setPermission('ROLE_SUPER_ADMIN');
        yield MenuItem::linkToCrud('Espaces', 'fas fa-th-large', Section::class)->setPermission('ROLE_SUPER_ADMIN');
        yield MenuItem::linkToCrud('Newsletters', 'fas fa-paper-plane', Newsletter::class)->setPermission('ROLE_SUPER_ADMIN');
        yield MenuItem::linkToCrud('Notifications', 'fas fa-bell', Notification::class)->setPermission('ROLE_SUPER_ADMIN');
        yield MenuItem::linkToCrud('Règles de taxes', 'fas fa-euro-sign', TaxRate::class)->setPermission('ROLE_SUPER_ADMIN');
        yield MenuItem::linkToCrud('Unités', 'fas fa-balance-scale', Unit::class)->setPermission('ROLE_SUPER_ADMIN');
        yield MenuItem::linkToCrud('Statuts de commande', 'fas fa-shopping-basket', OrderStatus::class)->setPermission('ROLE_SUPER_ADMIN');
*/

}
