import { ROUTE_PATH } from "@constants/routes";
import { Route, Routes } from "react-router";
import WHistory from "@widgets/WHistory";
import WWithdrawRecord from "@widgets/WWithdraw/WWithdrawRecord/WWithdrawRecord";
import WRechargeHistory from "@widgets/WDeposit/WRechargeHistory/WRechargeHistory";


const History = () => {
    const getSub = (route) => {
        return route.substring(route.lastIndexOf('/') + 1);
    }
    return (
        <Routes>
            <Route path="/" element={<WHistory />} >
                <Route path={getSub(ROUTE_PATH.DEPOSIT_HISTORY)} element={<WRechargeHistory />} />
                <Route path={getSub(ROUTE_PATH.WITHDRAW_HISTORY)} element={<WWithdrawRecord />} />
            </Route>
        </Routes>
    )
}


export default History;