import type { RouteRecordRaw } from 'vue-router'

import { adminPath, ADMIN_DASHBOARD_PATH } from '@/shared/utils/adminPath'

const adminMeta = { layout: 'admin', requiresAdmin: true }

export const adminRoutes: RouteRecordRaw[] = [
  { path: adminPath(), redirect: ADMIN_DASHBOARD_PATH },
  {
    path: adminPath('login'),
    name: 'admin-login',
    component: () => import('@/features/admin/views/AdminLoginView.vue'),
    meta: { layout: 'blank' },
  },
  {
    path: adminPath('dashboard'),
    name: 'admin-dashboard',
    component: () => import('@/features/admin/views/AdminDashboardView.vue'),
    meta: adminMeta,
  },
  {
    path: adminPath('users'),
    name: 'admin-users',
    component: () => import('@/features/admin/views/AdminUsersView.vue'),
    meta: adminMeta,
  },
  {
    path: adminPath('orders'),
    name: 'admin-orders',
    component: () => import('@/features/admin/views/AdminOrdersView.vue'),
    meta: adminMeta,
  },
  {
    path: adminPath('orders/:id'),
    name: 'admin-order-detail',
    component: () => import('@/features/admin/views/AdminOrderDetailView.vue'),
    meta: adminMeta,
  },
  {
    path: adminPath('listings'),
    name: 'admin-listings',
    component: () => import('@/features/admin/views/AdminListingsView.vue'),
    meta: adminMeta,
  },
  {
    path: adminPath('listings/:id'),
    name: 'admin-listing-detail',
    component: () => import('@/features/admin/views/AdminListingDetailView.vue'),
    meta: adminMeta,
  },
  {
    path: adminPath('listings/review'),
    name: 'admin-listing-review',
    component: () => import('@/features/admin/views/AdminListingReviewView.vue'),
    meta: adminMeta,
  },
  {
    path: adminPath('disputes'),
    name: 'admin-disputes',
    component: () => import('@/features/admin/views/AdminDisputesView.vue'),
    meta: adminMeta,
  },
  {
    path: adminPath('chats'),
    name: 'admin-chats',
    component: () => import('@/features/admin/views/AdminChatsView.vue'),
    meta: adminMeta,
  },
  {
    path: adminPath('qrcode-pool'),
    name: 'admin-qrcode-pool',
    component: () => import('@/features/admin/views/AdminQrCodePoolView.vue'),
    meta: adminMeta,
  },
  {
    path: adminPath('support-groups'),
    name: 'admin-support-groups',
    component: () => import('@/features/admin/views/AdminSupportGroupsView.vue'),
    meta: adminMeta,
  },
  {
    path: adminPath('finance/dashboard'),
    name: 'admin-finance-dashboard',
    component: () => import('@/features/admin/views/AdminFinanceDashboardView.vue'),
    meta: adminMeta,
  },
  {
    path: adminPath('finance/details'),
    name: 'admin-finance-details',
    component: () => import('@/features/admin/views/AdminFinanceDetailsView.vue'),
    meta: adminMeta,
  },
  {
    path: adminPath('wallet-ledger'),
    name: 'admin-wallet-ledger',
    component: () => import('@/features/admin/views/AdminWalletLedgerView.vue'),
    meta: adminMeta,
  },
  {
    path: adminPath('payments'),
    name: 'admin-payments',
    component: () => import('@/features/admin/views/AdminPaymentsView.vue'),
    meta: adminMeta,
  },
  {
    path: adminPath('withdrawals'),
    name: 'admin-withdrawals',
    component: () => import('@/features/admin/views/AdminWithdrawalsView.vue'),
    meta: adminMeta,
  },
  {
    path: adminPath('system-configs'),
    name: 'admin-system-configs',
    component: () => import('@/features/admin/views/AdminSystemConfigsView.vue'),
    meta: adminMeta,
  },
  {
    path: adminPath('payment-configs'),
    name: 'admin-payment-configs',
    component: () => import('@/features/admin/views/AdminPaymentConfigsView.vue'),
    meta: adminMeta,
  },
  {
    path: adminPath('audit-logs'),
    name: 'admin-audit-logs',
    component: () => import('@/features/admin/views/AdminAuditLogsView.vue'),
    meta: adminMeta,
  },
  {
    path: adminPath('notifications'),
    name: 'admin-notifications',
    component: () => import('@/features/admin/views/AdminNotificationsView.vue'),
    meta: adminMeta,
  },
  {
    path: adminPath('push'),
    name: 'admin-push',
    component: () => import('@/features/admin/views/AdminPushView.vue'),
    meta: adminMeta,
  },
  {
    path: adminPath('admin-users'),
    name: 'admin-admin-users',
    component: () => import('@/features/admin/views/AdminMgrUsersView.vue'),
    meta: adminMeta,
  },
  {
    path: adminPath('roles'),
    name: 'admin-roles',
    component: () => import('@/features/admin/views/AdminRolesView.vue'),
    meta: adminMeta,
  },
  {
    path: adminPath('announcements'),
    name: 'admin-announcements',
    component: () => import('@/features/admin/views/AdminAnnouncementsView.vue'),
    meta: adminMeta,
  },
]
