import { Icon } from '@lobehub/ui';
import { useTheme } from 'antd-style';
import {
  BadgeDollarSignIcon,
  BriefcaseIcon,
  Coffee,
  DramaIcon,
  GamepadIcon,
  GraduationCapIcon,
  ImageIcon,
  LanguagesIcon,
  LaughIcon,
  Layers,
  LayoutPanelTop,
  MicroscopeIcon,
  PencilIcon,
  PrinterIcon,
  TerminalSquareIcon,
  Star
} from 'lucide-react';
import { useTranslation } from 'react-i18next';

import { AssistantCategory } from '@/types/discover';

import { ICON_SIZE } from '../../../components/CategoryMenu';

export const useCategory = (fontsize?: number) => {
  const theme = useTheme();

  const { t } = useTranslation('discover');

  const size = fontsize ? { fontSize: fontsize } : ICON_SIZE;

  return [
    {
      icon: <Icon color="#003BFF" icon={LayoutPanelTop} size={size} />,
      key: AssistantCategory.All,
      label: t('category.assistant.all'),
    },
    {
      icon: <Icon color="#FFAD01" icon={Star} size={size} />,
      key: AssistantCategory.Collect,
      label: t('category.assistant.collect'),
    },
    {
      icon: <Icon color="#FF4D4D" icon={BriefcaseIcon} size={size} />,
      key: AssistantCategory.Academic,
      label: t('category.assistant.academic'),
    },
    {
      icon: <Icon color="#5BD941" icon={GraduationCapIcon} size={size} />,
      key: AssistantCategory.Education,
      label: t('category.assistant.education'),
    },
    {
      icon: <Icon color="#FF34AD" icon={PencilIcon} size={size} />,
      key: AssistantCategory.Marketing,
      label: t('category.assistant.marketing'),
    },
    {
      icon: <Icon color="#FF9B06" icon={ImageIcon} size={size} />,
      key: AssistantCategory.Design,
      label: t('category.assistant.design'),
    },
    {
      icon: <Icon color="#0095FF" icon={LaughIcon} size={size} />,
      key: AssistantCategory.Office,
      label: t('category.assistant.office'),
    },
    {
      icon: <Icon color="#00B0CB" icon={TerminalSquareIcon} size={size} />,
      key: AssistantCategory.Programming,
      label: t('category.assistant.programming'),
    },
    {
      icon: <Icon color="#E138FF" icon={GamepadIcon} size={size} />,
      key: AssistantCategory.Entertainment,
      label: t('category.assistant.entertainment'),
    },
    {
      icon: <Icon color="#0CD66D" icon={Coffee} size={size} />,
      key: AssistantCategory.Life,
      label: t('category.assistant.life'),
    },
    {
      icon: <Icon color="#003BFF" icon={Layers} size={size} />,
      key: AssistantCategory.General,
      label: t('category.assistant.general'),
    },
  ];
};

export const useCategoryItem = (key?: AssistantCategory, fontsize?: number) => {
  const items = useCategory(fontsize);
  if (!key) return;
  return items.find((item) => item.key === key);
};
