import { Navigate } from 'react-router';
import type { RouteObject } from 'react-router';
import { CentralLayout } from './CentralLayout';
import { NotFoundPage } from './pages/NotFoundPage';
import { CentralPage } from './pages/CentralPage';
import { DhcpPage } from './pages/DhcpPage';
import { FirewallPage } from './pages/FirewallPage';
import { IngressProxyPage } from './pages/IngressProxyPage';
import { DnsPage } from './pages/DnsPage';
import { CrowdSecPage } from './pages/CrowdSecPage';
import { VpnPage } from './pages/VpnPage';
import { CloudflarePage } from './pages/CloudflarePage';
import { CertificatesPage } from './pages/CertificatesPage';
import { DdnsPage } from './pages/DdnsPage';
import { LanDnsPage } from './pages/LanDnsPage';

export const routes: RouteObject[] = [
  {
    path: '/',
    element: <Navigate to="/central" replace />,
  },
  {
    path: '/central',
    element: <CentralLayout />,
    children: [
      { index: true, element: <CentralPage /> },
      { path: 'cloudflare', element: <CloudflarePage /> },
      { path: 'firewall', element: <FirewallPage /> },
      { path: 'dhcp', element: <DhcpPage /> },
      { path: 'crowdsec', element: <CrowdSecPage /> },
      { path: 'ingress', element: <IngressProxyPage /> },
      { path: 'dns', element: <DnsPage /> },
      { path: 'ddns', element: <DdnsPage /> },
      { path: 'lan-dns', element: <LanDnsPage /> },
      { path: 'vpn', element: <VpnPage /> },
      { path: 'certificates', element: <CertificatesPage /> },
    ],
  },
  {
    path: '*',
    element: <NotFoundPage />,
  },
];
