import { type FC } from 'react'
import { Route, Routes } from 'react-router-dom'
import Home from '../pages/home/Home'
import SideBar from '../shared/Sidebar'
import Header from '../shared/Header'
import { Paths } from '@/config/Paths'
import ProformaInvoice from '@/pages/invoice/ProformaInvoice'
import RequestList from '@/pages/requests/RequestList'
import ProductList from '@/pages/product/List'
import OrdersList from '@/pages/order/List'
import FeaturesList from '@/pages/features/List'
import CreateProduct from '@/pages/product/Create'
import CreateFeature from '@/pages/features/Create'
import PrintService from '@/pages/service/PrintService'
import DetailPerfomaInvoice from '@/pages/invoice/DetailPerfomaInvoice'
const MainRouter: FC = () => {
    return (
        <div className='p-4 overflow-hidden'>
            <Header />
            <SideBar />
            <div className='flex-1 xl:ms-[269px] mt-[68px] xl:mt-[81px]'>
                <div className={`overflow-auto w-[${window.innerWidth}] max-h-[calc(100vh-113px)]`}>
                    <div className='xl:pb-20 pb-32'>

                        <Routes>
                            <Route path="/" element={<Home />} />
                            <Route path={Paths.home} element={<Home />} />
                            <Route path={Paths.perfomaInvoice.list} element={<ProformaInvoice />} />
                            <Route path={Paths.perfomaInvoice.detail + ':id'} element={<DetailPerfomaInvoice />} />
                            <Route path={Paths.requests.list} element={<RequestList />} />
                            <Route path={Paths.product.list} element={<ProductList />} />
                            <Route path={Paths.product.create} element={<CreateProduct />} />
                            <Route path={Paths.order.list} element={<OrdersList />} />
                            <Route path={Paths.features.list} element={<FeaturesList />} />
                            <Route path={Paths.features.create} element={<CreateFeature />} />
                            <Route path={Paths.service.print} element={<PrintService />} />
                        </Routes>
                    </div>
                </div>
            </div>
        </div>
    )
}

export default MainRouter