import React from 'react';
import ReactDOM from 'react-dom/client'
import {
  createBrowserRouter,
  RouterProvider,
} from "react-router-dom";
import Root from "@/routes/Root";
import Error from "@/routes/Error";
import routes from "@/routes";
import '@/App.scss';
import 'reset-css';

const router = createBrowserRouter([{
  path: "/",
  element: <Root />,
  errorElement: <Error />,
  children: routes.filter((item) => item.routeable),
},]);

ReactDOM.createRoot(document.getElementById('root')).render(
  <React.StrictMode>
    <RouterProvider router={router} />
  </React.StrictMode>
)