import { Navigate } from 'react-router';
import Form from './Form';
import Layout from './Layout';
import List from './List';
import NotFound from './NotFound';

const routes = [
  {
    path: '/',
    element: <Layout />,
    children: [
      {
        path: '/list',
        element: <List />,
      },
      {
        path: '/form',
        element: <Form />,
      },
      {
        index: true,
        element: <Navigate to="/list" replace />,
      },
      {
        path: '*',
        element: <NotFound />,
      },
    ],
  },
];

export default routes;
