import {Routes, Route} from "react-router-dom";
import {createBrowserHistory} from "history";
import LoginView from "../pages/login/LoginView";
import HomeView from "../pages/HomeView";
import InvoiceListView from "../pages/Invoice/mine/InvoiceListView";
import MyReimbursement from "../pages/reimbursement/mine/MyReimbursement";
import {BrowserRouter} from "./BrowserRouter"
import InvoiceManagement from "../pages/Invoice/management/InvoiceManagement";
import ReimbursementApproval from "../pages/reimbursement/approval/ReimbursementApproval";
import StatView from "../pages/stat/StatView";

export const history = createBrowserHistory()

function CustomRouter() {
    return (
        <BrowserRouter history={history}>
            <Routes>
                <Route path="/" element={<HomeView/>}>
                    <Route path="invoice/mine" element={<InvoiceListView/>}></Route>
                    <Route path="reimbursement/mine" element={<MyReimbursement/>}></Route>
                    <Route path="invoice/management" element={<InvoiceManagement/>}></Route>
                    <Route path="reimbursement/approval" element={<ReimbursementApproval/>}></Route>
                    <Route path="stat" element={<StatView/>}></Route>
                </Route>
                <Route path="/login" element={<LoginView/>}></Route>
            </Routes>
        </BrowserRouter>
    )
}

export default CustomRouter