import { Navigate } from 'react-router';
import type { RouteObject } from 'react-router';
import { CentralLayout } from './CentralLayout';
import { NotFoundPage } from './pages/NotFoundPage';
import { DashboardPage } from './pages/DashboardPage';
import { DomainsPage } from './pages/DomainsPage';
import { FirewallPage } from './pages/FirewallPage';
import { VpnPage } from './pages/VpnPage';
import { CrowdSecPage } from './pages/CrowdSecPage';
import { DhcpPage } from './pages/DhcpPage';

export const routes: RouteObject[] = [
  {
    path: '/',
    element: <Navigate to="/central" replace />,
  },
  {
    path: '/central',
    element: <CentralLayout />,
    children: [
      { index: true, element: <DashboardPage /> },
      { path: 'domains', element: <DomainsPage /> },
      { path: 'firewall', element: <FirewallPage /> },
      { path: 'vpn', element: <VpnPage /> },
      { path: 'crowdsec', element: <CrowdSecPage /> },
      { path: 'dhcp', element: <DhcpPage /> },
    ],
  },
  {
    path: '*',
    element: <NotFoundPage />,
  },
];
