import DashboardLayout from '@/layouts/dashboard-layout';
import { Route, Routes } from 'react-router';
import Dashboard from './dashboard';
import LaporanBukuBesar from './laporan/akuntansi/buku_besar';
import LaporanLabaRugi from './laporan/akuntansi/laba_rugi';
import LaporanNeraca from './laporan/akuntansi/neraca';
import LaporanNominatifAnggota from './laporan/anggota/nominatif_anggota';
import LaporanNominatifDeposito from './laporan/deposito/nominatif_deposito';
import LaporanTransaksiPage from './laporan/laporan_transaksi';
import LaporanNominatifTabungan from './laporan/tabungan/nominatif_tabungan';
import LoginPage from './login';
import AnggotaPage from './master/anggota/anggota';
import DetailAnggotaPage from './master/anggota/detail_anggota';
import ProfilAnggotaPage from './master/anggota/profil_anggota';
import DepositoPage from './master/deposito/deposito';
import DetailDepositoPage from './master/deposito/detail_deposito';
import DetailKasPage from './master/kas/detail_kas';
import DetailKasBankPage from './master/kas/detail_penempatan';
import KasPage from './master/kas/kas';
import PenempatanBankPage from './master/kas/kas_bank';
import DetailTabunganPage from './master/tabungan/detail_tabungan';
import StatementTransaksiTabunganPage from './master/tabungan/statement_transaksi';
import TabunganPage from './master/tabungan/tabungan';
import SetupAkunPage from './pengaturan/akun/setup_akun';
import SetupBank from './pengaturan/bank/bank';
import SetupProdukDeposito from './pengaturan/produk/deposito';
import SetupProdukTabungan from './pengaturan/produk/tabungan';
import RolePage from './pengaturan/role/role_page';
import SetuPProfil from './pengaturan/setup_profil';
import SetupUser from './pengaturan/user/setup_user';
import BrowseTransaksiDepositoPage from './transaksi/deposito/browse_transaksi_deposito';
import FormTransaksiDepositoPage from './transaksi/deposito/transaksi_deposito';
import BrowseTransaksiKasPage from './transaksi/kas/browse_transaksi_kas';
import FormTransaksiKasPage from './transaksi/kas/transaksi_kas';
import BrowseTransaksiTabunganPage from './transaksi/tabungan/browse_transaksi_tabungan';
import FormTransaksiTabunganPage from './transaksi/tabungan/transaksi_tabungan';
import LaporanVerbalKas from './laporan/laporan_kas_verbal';
import StatementTransaksiKasPage from './master/kas/statement_transaksi_kas';
import StatementTransaksiPenempatanPage from './master/kas/statement_transaksi_penempatan';
import StatementBungaDepositoPage from './master/deposito/statement_bunga';

export default function main() {
    return (
        <Routes>
            <Route path="login" element={<LoginPage />} />
            <Route path="app" element={<DashboardLayout />}>
                <Route path="dashboard" element={<Dashboard />} />
                <Route path="master">
                    <Route path="anggota">
                        <Route index element={<AnggotaPage />} />
                        <Route path="add" element={<DetailAnggotaPage />} />
                        <Route path=":id" element={<DetailAnggotaPage />} />
                        <Route path=":id/profil" element={<ProfilAnggotaPage />} />
                    </Route>

                    <Route path="kas">
                        <Route index element={<KasPage />} />
                        <Route path=":id" element={<DetailKasPage />} />
                        <Route path=":id/statement-transaksi" element={<StatementTransaksiKasPage />} />
                    </Route>
                    <Route path="penempatan">
                        <Route index element={<PenempatanBankPage />} />
                        <Route path="add" element={<DetailKasBankPage />} />
                        <Route path=":id" element={<DetailKasBankPage />} />
                        <Route path=":id/statement-transaksi" element={<StatementTransaksiPenempatanPage />} />
                    </Route>

                    <Route path="tabungan">
                        <Route index element={<TabunganPage />} />
                        <Route path="add" element={<DetailTabunganPage />} />
                        <Route path=":id" element={<DetailTabunganPage />} />
                        <Route path=":id/statement-transaksi" element={<StatementTransaksiTabunganPage />} />
                    </Route>

                    <Route path="deposito">
                        <Route index element={<DepositoPage />} />
                        <Route path="add" element={<DetailDepositoPage />} />
                        <Route path=":id" element={<DetailDepositoPage />} />
                        <Route path=":id/statement-bunga" element={<StatementBungaDepositoPage />} />
                    </Route>
                </Route>

                <Route path="transaksi">
                    <Route path="tabungan" element={<BrowseTransaksiTabunganPage />} />
                    <Route path="tabungan/add" element={<FormTransaksiTabunganPage />} />
                    <Route path="deposito" element={<BrowseTransaksiDepositoPage />} />
                    <Route path="deposito/add" element={<FormTransaksiDepositoPage />} />
                    <Route path="kas" element={<BrowseTransaksiKasPage />} />
                    <Route path="kas/add" element={<FormTransaksiKasPage />} />
                </Route>

                <Route path="laporan">
                    <Route path="transaksi">
                        <Route index element={<LaporanTransaksiPage />} />
                        <Route path="verbal" element={<LaporanVerbalKas />} />
                    </Route>
                    <Route path="akuntansi">
                        <Route path="neraca" element={<LaporanNeraca />} />
                        <Route path="laba-rugi" element={<LaporanLabaRugi />} />
                        <Route path="buku-besar" element={<LaporanBukuBesar />} />
                    </Route>
                    <Route path="anggota" element={<LaporanNominatifAnggota />} />
                    <Route path="tabungan" element={<LaporanNominatifTabungan />} />
                    <Route path="deposito" element={<LaporanNominatifDeposito />} />
                </Route>

                <Route path="pengaturan">
                    <Route path="user">
                        <Route index element={<SetupUser />} />
                        <Route path="add" element={<DetailDepositoPage />} />
                        <Route path=":id" element={<DetailDepositoPage />} />
                    </Route>

                    <Route path="produk">
                        <Route path="tabungan" element={<SetupProdukTabungan />} />
                        <Route path="deposito" element={<SetupProdukDeposito />} />
                    </Route>

                    <Route path="role" element={<RolePage />} />
                    <Route path="bank" element={<SetupBank />} />
                    <Route path="akun" element={<SetupAkunPage />} />
                    <Route path="profil" element={<SetuPProfil />} />
                </Route>
                <Route path="*" element={<h1>404</h1>} />
            </Route>
        </Routes>
    );
}
