export function getProductTypeIcon(type: string): string {
  switch (type) {
    case 'KT':
      return 'TypeBook';
    case 'GEB':
      return 'TypeBook';
  }
}

export const monthNames = [
  'January',
  'February',
  'March',
  'April',
  'May',
  'June',
  'July',
  'August',
  'September',
  'October',
  'November',
  'December',
];

export function getFormatedPublicationDate(publicationDate: Date): string {
  return (
    new Date(publicationDate).getDay().toString() +
    '. ' +
    monthNames[new Date(publicationDate).getMonth()] +
    ' ' +
    new Date(publicationDate).getFullYear()
  );
}

export function allowedAvailabilityStatusCodes(code: number): boolean {
  return [2, 32, 256, 1024, 2048, 4096].findIndex((allowedCode) => allowedCode === code) !== -1;
}
