import { CopyTypePath } from 'src/types/deeplinks';

export const linkTypesBuilder: Record<
  string,
  (id?: number | string, subId?: number, hash?: string) => string
> = {
  [CopyTypePath.NEWS]: () => '/news',
  [CopyTypePath.ARTICLE]: id => `/news/${id}`,
  [CopyTypePath.FORMS]: () => '/forms',
  [CopyTypePath.FORM]: id => `/forms/${id}`,
  [CopyTypePath.PDF_FORM]: id => `/forms/pdf/${id}`,
  [CopyTypePath.SURVEYS]: () => '/surveys',
  [CopyTypePath.SURVEY]: id => `/surveys/${id}`,
  [CopyTypePath.ONBOARDINGS]: () => '/onboarding',
  [CopyTypePath.ONBOARDING]: id => `/onboarding/${id}`,
  [CopyTypePath.ACKNOWLEDGEMENTS]: () => '/acknowledgements',
  [CopyTypePath.FILES]: () => '/files',
  [CopyTypePath.FILE]: id => `/files/${id}`,
  [CopyTypePath.FOLDER]: id => `/files/${id}`,
  [CopyTypePath.LIBRARY]: id => `/library/${id}`,
  [CopyTypePath.LIBRARY_ARTICLE]: (id, subId) =>
    `/library/${id}/articles/${subId}`,
  [CopyTypePath.TOPICS]: () => '/topics',
  [CopyTypePath.TOPIC]: id => `/topics/${id}`,
  [CopyTypePath.WIDGETS]: () => '/widgets',
  [CopyTypePath.DOCUMENTS]: () => '/documents',
  [CopyTypePath.DOCUMENT]: id => `/documents/${id}`,
  [CopyTypePath.COURSES]: () => '/courses',
  [CopyTypePath.COURSE]: id => `/courses/${id}`,
  [CopyTypePath.SESSION]: id => `/sessions/${id}`,
  [CopyTypePath.PATH]: id => `/paths/${id}`,
  [CopyTypePath.WORKFLOWS]: id => `/service-portal/service-items/${id}`,
  [CopyTypePath.SERVICE_ITEMS_BY_CATEGORY]: id =>
    `/service-portal/service-items?category=${id}`,
} as const;
