import { Route, Routes } from 'react-router-dom'
import { Layout } from './layout'
import { routes } from './routes'

function App() {
  return (
    <Routes>
      <Route element={<Layout />}>
        {routes.map((route, index) => (
          <Route
            key={route.path + index}
            path={route.path}
            element={route.element}
          />
        ))}
      </Route>
    </Routes>
  )
}

export default App
