import { __ } from '@wordpress/i18n';
import { Outlet, createHashRouter } from 'react-router-dom';
import Main from '../layout/Main';
import BadgesEditor from '../pages/Badges/BadgesEditor/BadgesEditor';
import BadgesManager from '../pages/Badges/BadgesManager/BadgesManager';
import FilterEditor from '../pages/Filters/FilterEditor/FilterEditor';
import FiltersManager from '../pages/Filters/FiltersManager/FiltersManager';
import Settings from '../pages/Settings/Settings';

const router = createHashRouter([
  {
    path: '/',
    element: <Main />,
    children: [
      {
        index: '/',
        element: <Outlet />,
        children: [
          {
            index: true,
            element: <BadgesManager />,
          },
          {
            path: 'editor',
            element: <BadgesEditor />,
          },
        ],
      },

      {
        path: '/filters',
        element: <Outlet />,
        children: [
          {
            index: true,
            element: <FiltersManager />,
          },
          {
            path: 'editor',
            element: <FilterEditor />,
          },
        ],
      },
      {
        path: 'settings',
        element: <Settings />,
      },
    ],
  },

  {
    path: '*',
    element: <div> {__('Page Not Found', 'custom-product-badge-for-woocommerce')}</div>,
  },
]);

export default router;
