import { createBrowserRouter, Navigate } from 'react-router-dom';
import { MainLayout } from '../layouts/MainLayout';
import { Dashboard } from '../pages/Dashboard';
import { Upload } from '../pages/Upload';
import { Gallery } from '../pages/Gallery';
import { Links } from '../pages/Links';
import { Tools } from '../pages/Tools';
import { Storage } from '../pages/Storage';
import { Analytics } from '../pages/Analytics';
import { Settings } from '../pages/Settings';

export const router = createBrowserRouter([
  {
    path: '/',
    element: <MainLayout />,
    children: [
      {
        index: true,
        element: <Navigate to="/dashboard" replace />,
      },
      {
        path: 'dashboard',
        element: <Dashboard />,
      },
      {
        path: 'upload',
        element: <Upload />,
      },
      {
        path: 'gallery',
        element: <Gallery />,
      },
      {
        path: 'links',
        element: <Links />,
      },
      {
        path: 'tools',
        element: <Tools />,
      },
      {
        path: 'storage',
        element: <Storage />,
      },
      {
        path: 'analytics',
        element: <Analytics />,
      },
      {
        path: 'settings',
        element: <Settings />,
      },
    ],
  },
]);
