import { ReactElement } from 'react';
import { Navigate, Route, Routes } from 'react-router';
import { AccountUserProfilePage } from '@/pages/account';
import { AuthPage } from '@/auth';
import { RequireAuth } from '@/auth/RequireAuth';
import { Demo2Layout } from '@/layouts/demo2';
import { ErrorsRouting } from '@/errors';

import DashboardHomePage from '@/pages/dashboards/home/DashboardHomePage';
import ManageUserPage from '@/pages/settings/user/manage-user/ManageUserPage';
import ManageSitesPage from '@/pages/sites/manage-sites/ManageSitesPage';

import Transaction from '@/pages/transaction/history-transaction/Transaction';
import ApprovalTransaction from '@/pages/transaction/approval-transaction/ApprovalTransaction';
import TransactionTopup from '@/pages/transaction/topup/TransactionTopup';
import TransactionDisbursement from '@/pages/transaction/disbursement-saldo/TransactionDisbursement';
import TransactionWithdraw from '@/pages/transaction/withdrawl-saldo/TransactionWithdraw';
import LogActivityPage from '@/pages/settings/user/log-activity/LogActivityPage';
import ManagePositionPage from '@/pages/settings/user/manage-position/ManagePositionPage';
import ManageAccount from '@/pages/account/manage-account/ManageAccount';
import ManageGroups from '@/pages/groups/ManageGroups';
import ManageMembers from '@/pages/members/manage-members/ManageMembers';
import ManageKycDeletion from '@/pages/members/kyc-delete-member/ManageKycDeletion';
import Kyc from '@/pages/members/kyc/Kyc';
import AccessType from '@/pages/access/access-type/AccessType';
import MemberCredential from '@/pages/access/member-credentials/MemberCredentials';
import ManageCurrency from '@/pages/account/manage-currency/ManageCurrency';
import ManageNotification from '@/pages/notification/ManageNotification';
import ManageMenu from '@/pages/menu/manage-menu/ManageMenu';
import Welcome from '@/pages/menu/welcome/Welcome';
import Inbox from '@/pages/message/Inbox';
import ManageWebServices from '@/pages/webservice/ManageWebServices';
import TransferType from '@/pages/transfer/transfertype/TransferType';
import MasterData from '@/pages/master/MasterData';
import PointiersMaster from '@/pages/master/pointiers/PointiersMaster';
import PostoAdmsMaster from '@/pages/master/postoadms/PostoAdmsMaster';
import SucosMaster from '@/pages/master/sucos/SucosMaster';
import AldeiasMaster from '@/pages/master/aldeias/AldeiasMaster';
import Municipios from '@/pages/master/municipios/Municipios';
import ProfessionMaster from '@/pages/master/profession/ProfessionMaster';
import ProductsMaster from '@/pages/master/products/ProductsMaster';
import ProviderMaster from '@/pages/master/provider/ProviderMaster';
import ConversionMaster from '@/pages/master/conversion/ConversionMaster';
import RewardMaster from '@/pages/master/reward/RewardMaster';
import WalletRuleMaster from '@/pages/master/walletRule/WalletRuleMaster';
import WalletStatement from '@/pages/wallet/wallet-statement/WalletStatement';
import WalletMaster from '@/pages/master/wallet/WalletMaster';
import CurrencyMaster from '@/pages/master/currency/CurrencyMaster';
import FeedbackMemberMaster from '@/pages/members/feedback-member/FeedbackMember';
import AgentBalance from '@/pages/members/agent-balance/AgentBalance';

// DISBURSEMENT
import HistoryTransactionDisbursement from '@/pages/disbursement/history-transaction/HistoryTransaction';
import SearchMember from '@/pages/members/search-member/SearchMember';
import WithdrawalEmoney from '@/pages/transaction/withdrawl-emoney/WithdrawalEmoney';
import ManageCards from '@/pages/cards/manage-card/ManageCard';
import HistoryCard from '@/pages/cards/history-card/HistoryCard';

import ComingSoonPage from '@/pages/ComingSoonPage';

const AppRoutingSetup = (): ReactElement => {
  return (
    <Routes>
      <Route element={<RequireAuth />}>
        <Route element={<Demo2Layout />}>
          <Route path="/" element={<DashboardHomePage />} />
          <Route path="/account/home/user-profile" element={<AccountUserProfilePage />} />
          <Route path="/coming-soon" element={<ComingSoonPage />} />
          <Route path="/settings/user-management/manage-user" element={<ManageUserPage />} />

          <Route path="/sites/manage-sites" element={<ManageSitesPage />} />

          {/* <Route path="/master-data" element={<MasterData />} />
          <Route path="/master-data/municipios" element={<Municipios />} />
          <Route path="/master-data/postoadms" element={<PostoAdmsMaster />} />
          <Route path="/master-data/sucos" element={<SucosMaster />} />
          <Route path="/master-data/aldeias" element={<AldeiasMaster />} />
          <Route path="/master-data/profession" element={<ProfessionMaster />} />
          <Route path="/master-data/products" element={<ProductsMaster />} />
          <Route path="/master-data/provider" element={<ProviderMaster />} />
          <Route
            path="/master-data/municipios/postoadms/:municipioId"
            element={<PostoAdmsMaster />}
          />
          <Route path="/master-data/conversion" element={<ConversionMaster />} />

          <Route path="/master-data/currency/" element={<CurrencyMaster />} />

          <Route path="/master-data/reward/" element={<RewardMaster />} />

          <Route path="/master-data/pointiers/" element={<PointiersMaster />} />

          <Route path="/master-data/wallet" element={<WalletMaster />} />

          <Route path="/master-data/wallet-rule" element={<WalletRuleMaster />} />

          

          <Route path="/groups/group-management" element={<ManageGroups />} />

          <Route path="/members/kyc" element={<Kyc />} />
          <Route path="/members/member-management" element={<ManageMembers />} />
          <Route path="/members/kyc-delete-member" element={<ManageKycDeletion />} />
          <Route path="/members/create-member-credential" element={<MemberCredential />} />
          <Route path="/members/feedback-member" element={<FeedbackMemberMaster />} />
          <Route path="/members/agent-balance" element={<AgentBalance />} />
          <Route path="/members/search-member" element={<SearchMember />} />
          <Route path="/members/search-member" element={<SearchMember />} /> */}

          {/* cards */}
          {/* <Route path="/cards/manage-card" element={<ManageCards />} />

          <Route path="/cards/card-history" element={<HistoryCard />} />

          <Route path="/access/access-type-management" element={<AccessType />} />

          <Route path="/accounts/account-management" element={<ManageAccount />} />
          <Route path="/accounts/currency-management" element={<ManageCurrency />} />

          <Route path="/transfer-type/transfer-type-management" element={<TransferType />} />

          <Route path="/wallet/wallet-statement" element={<WalletStatement />} />

          <Route path="/notification/notification-management" element={<ManageNotification />} />

          <Route path="/transaction" element={<Transaction />} />
          <Route path="/approval-transaction" element={<ApprovalTransaction />} />
          <Route path="/transaction/topup" element={<TransactionTopup />} />
          <Route path="/transaction/disbursement-saldo" element={<TransactionDisbursement />} />
          <Route path="/transaction/withdrawl-saldo" element={<TransactionWithdraw />} />
          <Route path="/transaction/withdrawal-emoney" element={<WithdrawalEmoney />} />
          <Route path="/menu/menu-management" element={<ManageMenu />} />
          <Route path="/menu/welcome" element={<Welcome />} />
          <Route path="/message/inbox" element={<Inbox />} />
          <Route path="/webservice/webservice-management" element={<ManageWebServices />} />
          <Route path="/settings/user-management/log-activity" element={<LogActivityPage />} />
          <Route
            path="/settings/user-management/manage-position"
            element={<ManagePositionPage />}
          /> */}

          {/* DISBURSEMENT  */}
          {/* <Route
            path="/disbursement/transaction-history"
            element={<HistoryTransactionDisbursement />}
          /> */}
          {/* DISBURSEMENT */}
        </Route>
      </Route>
      <Route path="error/*" element={<ErrorsRouting />} />
      <Route path="auth/*" element={<AuthPage />} />
      <Route path="*" element={<Navigate to="/error/404" />} />
    </Routes>
  );
};

export { AppRoutingSetup };
