import type { RouteRecordRaw } from 'vue-router'

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

export const adminRoutes: RouteRecordRaw[] = [
  { path: '/admin', redirect: '/admin/dashboard' },
  {
    path: '/admin/login',
    name: 'admin-login',
    component: () => import('@/features/admin/views/AdminLoginView.vue'),
    meta: { layout: 'blank' },
  },
  {
    path: '/admin/dashboard',
    name: 'admin-dashboard',
    component: () => import('@/features/admin/views/AdminDashboardView.vue'),
    meta: adminMeta,
  },
  {
    path: '/admin/users',
    name: 'admin-users',
    component: () => import('@/features/admin/views/AdminUsersView.vue'),
    meta: adminMeta,
  },
  {
    path: '/admin/orders',
    name: 'admin-orders',
    component: () => import('@/features/admin/views/AdminOrdersView.vue'),
    meta: adminMeta,
  },
  {
    path: '/admin/orders/:id',
    name: 'admin-order-detail',
    component: () => import('@/features/admin/views/AdminOrderDetailView.vue'),
    meta: adminMeta,
  },
  {
    path: '/admin/listings',
    name: 'admin-listings',
    component: () => import('@/features/admin/views/AdminListingsView.vue'),
    meta: adminMeta,
  },
  {
    path: '/admin/listings/:id',
    name: 'admin-listing-detail',
    component: () => import('@/features/admin/views/AdminListingDetailView.vue'),
    meta: adminMeta,
  },
  {
    path: '/admin/listings/review',
    name: 'admin-listing-review',
    component: () => import('@/features/admin/views/AdminListingReviewView.vue'),
    meta: adminMeta,
  },
  {
    path: '/admin/disputes',
    name: 'admin-disputes',
    component: () => import('@/features/admin/views/AdminDisputesView.vue'),
    meta: adminMeta,
  },
  {
    path: '/admin/chats',
    name: 'admin-chats',
    component: () => import('@/features/admin/views/AdminChatsView.vue'),
    meta: adminMeta,
  },
  {
    path: '/admin/wallet-ledger',
    name: 'admin-wallet-ledger',
    component: () => import('@/features/admin/views/AdminWalletLedgerView.vue'),
    meta: adminMeta,
  },
  {
    path: '/admin/system-configs',
    name: 'admin-system-configs',
    component: () => import('@/features/admin/views/AdminSystemConfigsView.vue'),
    meta: adminMeta,
  },
  {
    path: '/admin/audit-logs',
    name: 'admin-audit-logs',
    component: () => import('@/features/admin/views/AdminAuditLogsView.vue'),
    meta: adminMeta,
  },
  {
    path: '/admin/admin-users',
    name: 'admin-admin-users',
    component: () => import('@/features/admin/views/AdminMgrUsersView.vue'),
    meta: adminMeta,
  },
  {
    path: '/admin/roles',
    name: 'admin-roles',
    component: () => import('@/features/admin/views/AdminRolesView.vue'),
    meta: adminMeta,
  },
]
