import {
  EWALLET as URL_PREFIX,
  EWALLET_HOME,
  EWALLET_ACTIVATION,
  EWALLET_FUND_TRANSFER,
  EWALLET_FUND_WITHDRAWAL,
  EWALLET_TRANSFER_RECORD,
  EWALLET_TRANSACTION_HISTORY,
  EWALLET_TRANSACTION_DETAILS,
} from '@/config/url-prefix'

export default [
  {
    path: URL_PREFIX,
    component: () => import('@/elements/templates/screens/SidebarFluid'),
    name: 'EWallet',
    redirect: { name: 'EWalletHome' },
    meta: {
      dashboardMenu: {
        displayName: 'EWallet.Title',
        priority: 5,
        icon: 'sidebar-ewallet',
      },
      policy: {
        'e-wallet': 'view',
      },
    },
    children: [
      {
        path: EWALLET_HOME,
        component: () => import('@/app/ewallet/dashboard/EWalletDashboard'),
        name: 'EWalletHome',
        redirect: { name: 'EWalletTransactionHistoryPaginated' },
        meta: {
          title: 'EWallet.Title',
        },
        children: [
          {
            path: EWALLET_TRANSACTION_HISTORY,
            component: () => import('@/app/ewallet/dashboard/Components/blocks/EWalletTransactionHistory'),
            name: 'EWalletTransactionHistoryPaginated',
            meta: {
              title: 'EWallet.Title',
              tabDisplayName: 'EWallet.TransactionHistory',
            },
          },
          {
            path: EWALLET_TRANSFER_RECORD,
            component: () => import('@/app/ewallet/dashboard/Components/blocks/EWalletTransferRecord'),
            name: 'EWalletTransferRecordPaginated',
            meta: {
              title: 'EWallet.Title',
              tabDisplayName: 'EWallet.EWalletTransferRecord',
            },
          },
        ],
      },
      {
        path: EWALLET_ACTIVATION,
        component: () => import('@/app/ewallet/activation/components/EWalletActivationWrapper'),
        name: 'EWalletActivation',
      },
      {
        path: EWALLET_FUND_TRANSFER,
        component: () => import('@/app/ewallet/fund-transfer/EWalletFundTransferWrapper'),
        name: 'EWalletFundTransfer',
        meta: {
          title: 'EWallet.FundTransfer',
        },
      },
      {
        path: EWALLET_FUND_WITHDRAWAL,
        component: () => import('@/app/ewallet/fund-withdrawal/EWalletFundWithdrawalWrapper'),
        name: 'EWalletFundWithdrawal',
        meta: {
          title: 'EWallet.FundWithdrawal',
        },
      },
      {
        path: EWALLET_TRANSACTION_DETAILS + '/:transactionId',
        component: () => import('@/app/ewallet/transaction-details/EWalletTransactionDetails'),
        name: 'EWalletTransactionDetails',
        props: true,
        meta: {
          title: 'Common.Sales.TransactionDetails',
        },
      },
    ],
  },
]
