import Add from '../views/Add';
import Update from '../views/Update';
import Details from '../views/Details';
import Search from '../views/Search';
import Error from '../views/Error';
import { createBrowserRouter } from 'react-router-dom';
import Statistics from '../views/Statistics';
import DetailsManu from '../views/DetailsManu';
import AddManu from '../views/AddManu';
import UpdateManu from '../views/UpdateManu';

const routes = createBrowserRouter([
  {
    path: '/',
    element: <Search />,
    errorElement: <Error />
  },
  {
    path: '/details/:id',
    element: <Details />,
    errorElement: <Error />
  },
  {
    path: '/add',
    element: <Add />,
    errorElement: <Error />
  },
  {
    path: '/update/:id',
    element: <Update />,
    errorElement: <Error />
  },
  {
    path: 'stats',
    element: <Statistics />,
    errorElement: <Error />
  },
  {
    path: '/manufacturer/details/:id',
    element: <DetailsManu />,
    errorElement: <Error />
  },
  {
    path: '/manufacturer/add',
    element: <AddManu />,
    errorElement: <Error />
  },
  {
    path: '/manufacturer/update/:id',
    element: <UpdateManu />,
    errorElement: <Error />
  }
]);

export default routes;
