import { NamedRoutes } from '@/core';
import { Routes } from '@angular/router';

export type TPartnersRouteNames = 'partners' | 'partner';

export const superAdminPartnersNamedRoutes: NamedRoutes<TPartnersRouteNames> = {
  partners: {
    path: 'partners',
    loadComponent: () => import('../../views/list.component').then((m) => m.PartnersComponent),
    meta: {
      title: 'شرکای تجاری',
      pagePath: () => '/super_admin/partners',
    },
  },
  partner: {
    path: 'partners/:partnerId',
    loadComponent: () => import('../../views/single.component').then((m) => m.PartnerComponent),
    meta: {
      title: 'شریک تجاری',
      pagePath: (guildId: string) => `/super_admin/partners/${guildId}`,
    },
  },
};

export const SUPER_ADMIN_PARTNERS_ROUTES: Routes = [
  superAdminPartnersNamedRoutes.partners,
  {
    path: 'partners/:partnerId',
    loadComponent: () =>
      import('../../components/layout.component').then((m) => m.GuildLayoutComponent),

    children: [
      {
        path: '',
        loadComponent: () => import('../../views/single.component').then((m) => m.PartnerComponent),
      },
    ],
  },
];
