import React from 'react'
import { Route, Routes } from 'react-router-dom';
import NotFound from '../Pages/NotFound';
import { Box } from '@chakra-ui/react';
import Header from '../Components/Header';
import Footer from '../Components/Footer';
import { RouteLink } from '../Routes/RoutLink';

const DefaultLayout = () => {
  return (
    <Box>
        <Header />
        <AppContent/>
        <Footer/>
    </Box>
  )
}

export default DefaultLayout


const AppContent = () => {
    return (
      <Routes>
        {RouteLink.map(({ path, Component }, index) => (
          <Route key={index} path={path} element={<Component />} />
        ))}
        <Route path="*" element={<NotFound />} />
      </Routes>
    );
  };
  