import { 
  CircleChatIcon,
  CircleCheckIcon,
  CirclePencilIcon,
  CirclePlayIcon,
  CircleQuoteIcon,
  CircleSatisfactionIcon
} from '@/icon';

export const CurriculumListIcons = {
  pencil: CirclePencilIcon,
  video: CirclePlayIcon,
  quote: CircleQuoteIcon,
  check: CircleCheckIcon,
  star: CircleSatisfactionIcon,
};

export const getCurriculumIcon = ({
  type,
  icon,
}: {
  type: string;
  icon?: string;
}): typeof CirclePlayIcon => {
  if (icon && Object.prototype.hasOwnProperty.call(CurriculumListIcons, icon)) {
    return CurriculumListIcons[icon as keyof typeof CurriculumListIcons];
  }

  switch (type) {
    case 'video':
      return CirclePlayIcon;
    case 'question_text':
      return CircleQuoteIcon;
    case 'question_radio':
      return CircleCheckIcon;
    case 'question_satisfaction_option':
    case 'question_satisfaction_text':
      return CircleSatisfactionIcon;
    case 'aiTraining':
      return CircleChatIcon;
    case 'review':
    default:
      return CirclePencilIcon;
  }
};

export const getCurriculumIconColor = ({
  done = false,
  selected = false,
}: {
  done?: boolean;
  selected?: boolean;
}): string => {
  if (selected) {
    return '#D5AE39';
  }
  if (done) {
    return '#30A46C';
  }
  return '#D9D9E0';
};

export const getCurriculumQuestionIconColor = (type: string): string => {
  switch (type) {
    case 'question_text':
      return '#D5AE39';
    case 'question_radio':
      return '#30A46C';
    default:
      return '#D9D9E0';
  }
};

export const getCurriculumQuestionTypeDescription = (type: string): string => {
  switch (type) {
    case 'question_text':
      return '주관식';
    case 'question_radio':
      return '객관식';
    default:
      return '';
  }
};

export const getCurriculumContentSubTypeText = (type: string): string => {
  switch (type) {
    case 'video':
      return '영상';
    case 'review':
      return '리뷰';
    case 'aiTraining':
      return 'AI 트레이닝';
    default:
      return '';
  }
};
 
