import { FC } from 'react'
import SideBar from '../shared/SideBar'
import Header from '../shared/Header'
import { Route, Routes } from 'react-router-dom'
import { Pages } from '../config/Pages'
import Home from '../pages/home/Home'
import MyServices from '../pages/service/MyServices'
import TicketList from '../pages/ticket/TicketList'
import CreateTicket from '../pages/ticket/CreateTicket'
import TicketDetail from '../pages/ticket/Detail'
import TransactionList from '../pages/transaction/List'
import ReceiptsList from '../pages/receipts/List'
import AnnouncementtList from '../pages/annoncement/List'
import AddCriticisms from '../pages/criticisms/Add'
import LearningList from '../pages/learning/List'
import Setting from '../pages/setting/Setting'
import Wallet from '../pages/wallet/Wallet'
import ReceiptsDetail from '../pages/receipts/Detail'
import Profile from '../pages/profile/Profile'

const MainRouter: FC = () => {
    return (
        <div className='p-4 overflow-hidden'>
            <SideBar />
            <Header />
            <div className='flex-1 ms-[269px] mt-[81px]'>
                <div className={`overflow-auto w-[${window.innerWidth}] max-h-[calc(100vh-113px)]`}>
                    <div>
                        <Routes>
                            <Route path={Pages.dashboard} element={<Home />} />
                            <Route path={Pages.services.mine} element={<MyServices />} />
                            <Route path={Pages.ticket.list} element={<TicketList />} />
                            <Route path={Pages.ticket.create} element={<CreateTicket />} />
                            <Route path={Pages.ticket.detail + ':id'} element={<TicketDetail />} />
                            <Route path={Pages.transactions} element={<TransactionList />} />
                            <Route path={Pages.receipts.index} element={<ReceiptsList />} />
                            <Route path={Pages.receipts.detail + ':id'} element={<ReceiptsDetail />} />
                            <Route path={Pages.announcement} element={<AnnouncementtList />} />
                            <Route path={Pages.criticisms} element={<AddCriticisms />} />
                            <Route path={Pages.learning} element={<LearningList />} />
                            <Route path={Pages.setting} element={<Setting />} />
                            <Route path={Pages.wallet} element={<Wallet />} />
                            <Route path={Pages.profile} element={<Profile />} />
                        </Routes>
                    </div>
                </div>
            </div>
        </div>
    )
}

export default MainRouter