import {
  IconCircleCheck,
  IconFileSpreadsheet,
  IconLock,
  IconNotes,
  IconPdf,
  IconPresentationAnalytics,
  IconProgressCheck,
  type TablerIcon,
} from '@material-hu/icons/tabler';

import { type FilesExtensions } from 'src/types/attachments';

import { TaskStatus } from './types';

export const TASKS_STATUS_ICONS: Record<TaskStatus, TablerIcon> = {
  [TaskStatus.FINISHED_OK]: IconCircleCheck,
  [TaskStatus.IN_PROGRESS]: IconProgressCheck,
  [TaskStatus.PENDING]: IconLock,
  [TaskStatus.FINISHED_FAIL]: IconCircleCheck,
  [TaskStatus.FAILED]: IconProgressCheck,
};

export const FILE_EXTENSION_ICONS: Record<FilesExtensions, TablerIcon> = {
  pdf: IconPdf,
  doc: IconNotes,
  docx: IconNotes,
  xls: IconFileSpreadsheet,
  xlsx: IconFileSpreadsheet,
  ppt: IconPresentationAnalytics,
  pptx: IconPresentationAnalytics,
};

export const DESCRIPTION_MAX_LENGTH = 250;
export const WARNING_MINUTES = 1;
export const MAX_TEXT_LENGTH = 1000;
export const COURSE_IMG_ASPECT_RATIO = '2/1';
export const DETAIL_SURVEY_TIME_DELAY = 2000;
export const COMPLETED_SURVEY_TIME_DELAY = 1000;
export const TASK_VIDEO_MAX_HEIGHT = 502;
export const COURSE_DETAIL_SIDE_WIDTH = 385;

export const DONUT_CHART_SIZE = 200;

export const DONUT_CHART_BORDERLESS_DATASET = {
  borderWidth: 0,
  hoverBorderWidth: 0,
} as const;
