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

export type TGoodsRouteNames = 'goods';

const baseUrl = (businessId: string) => `/consumer/business_activities/${businessId}/goods`;

export const consumerBusinessActivityGoodsNamedRoutes: NamedRoutes<TGoodsRouteNames> = {
  goods: {
    path: 'goods',
    loadComponent: () =>
      import('../../views/goods/list.component').then(
        (m) => m.ConsumerBusinessActivityGoodsComponent,
      ),
    // @ts-ignore
    meta: {
      title: 'کالاها',
      pagePath: (businessId: string) => baseUrl(businessId),
    },
  },
  // good: {
  //   path: 'goods/:goodId',
  //   loadComponent: () =>
  //     import('../../views/goods/single.component').then((m) => m.SuperAdminUserPosComponent),
  //   // @ts-ignore
  //   meta: {
  //     title: 'پایانه فروش',
  //     pagePath: (businessId: string, complexId: string, goodId: string) =>
  //       `${baseUrl(businessId)}/${goodId}`,
  //   },
  // },
};

export const CONSUMER_BUSINESS_ACTIVITY_GOODS_ROUTES: Routes = [
  consumerBusinessActivityGoodsNamedRoutes.goods,
  // {
  //   path: consumerBusinessActivityGoodsNamedRoutes.good.path,
  //   loadComponent: () =>
  //     import('../../components/goods/layout.component').then(
  //       (m) => m.SuperAdminConsumerPosLayoutComponent,
  //     ),
  //   children: [
  //     {
  //       path: '',
  //       loadComponent: consumerBusinessActivityGoodsNamedRoutes.good.loadComponent,
  //     },
  //   ],
  // },
];
