import { Box, Flex } from '@chakra-ui/react';
import React from 'react';
import { Navigate, Route, Routes } from 'react-router-dom';

import Sidebar from '../Sidebar';
import Orders from '../Orders';
import Masters from '../Masters';

const LayoutArm = () => (
  <Flex h='100vh'>
    <Sidebar />
    <Box flex='1' bg='gray.50'>
      <Routes>
        <Route>
          <Route index element={<Navigate to='orders' replace />} />
          <Route path='orders' element={<Orders />} />
          <Route path='masters' element={<Masters />} />
        </Route>
      </Routes>
    </Box>
  </Flex>
);

export default LayoutArm;
