feature-icon.tsx 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. import type { FC } from 'react'
  2. import { useTranslation } from 'react-i18next'
  3. import ModelBadge from '../model-badge'
  4. import {
  5. ModelFeatureEnum,
  6. ModelFeatureTextEnum,
  7. } from '../declarations'
  8. import {
  9. // MagicBox,
  10. MagicEyes,
  11. // MagicWand,
  12. // Robot,
  13. } from '@/app/components/base/icons/src/vender/solid/mediaAndDevices'
  14. import TooltipPlus from '@/app/components/base/tooltip-plus'
  15. type FeatureIconProps = {
  16. feature: ModelFeatureEnum
  17. className?: string
  18. }
  19. const FeatureIcon: FC<FeatureIconProps> = ({
  20. className,
  21. feature,
  22. }) => {
  23. const { t } = useTranslation()
  24. // if (feature === ModelFeatureEnum.agentThought) {
  25. // return (
  26. // <TooltipPlus
  27. // popupContent={t('common.modelProvider.featureSupported', { feature: ModelFeatureTextEnum.agentThought })}
  28. // >
  29. // <ModelBadge className={`mr-0.5 !px-0 w-[18px] justify-center text-gray-500 ${className}`}>
  30. // <Robot className='w-3 h-3' />
  31. // </ModelBadge>
  32. // </TooltipPlus>
  33. // )
  34. // }
  35. // if (feature === ModelFeatureEnum.toolCall) {
  36. // return (
  37. // <TooltipPlus
  38. // popupContent={t('common.modelProvider.featureSupported', { feature: ModelFeatureTextEnum.toolCall })}
  39. // >
  40. // <ModelBadge className={`mr-0.5 !px-0 w-[18px] justify-center text-gray-500 ${className}`}>
  41. // <MagicWand className='w-3 h-3' />
  42. // </ModelBadge>
  43. // </TooltipPlus>
  44. // )
  45. // }
  46. // if (feature === ModelFeatureEnum.multiToolCall) {
  47. // return (
  48. // <TooltipPlus
  49. // popupContent={t('common.modelProvider.featureSupported', { feature: ModelFeatureTextEnum.multiToolCall })}
  50. // >
  51. // <ModelBadge className={`mr-0.5 !px-0 w-[18px] justify-center text-gray-500 ${className}`}>
  52. // <MagicBox className='w-3 h-3' />
  53. // </ModelBadge>
  54. // </TooltipPlus>
  55. // )
  56. // }
  57. if (feature === ModelFeatureEnum.vision) {
  58. return (
  59. <TooltipPlus
  60. popupContent={t('common.modelProvider.featureSupported', { feature: ModelFeatureTextEnum.vision })}
  61. >
  62. <ModelBadge className={`mr-0.5 !px-0 w-[18px] justify-center text-gray-500 ${className}`}>
  63. <MagicEyes className='w-3 h-3' />
  64. </ModelBadge>
  65. </TooltipPlus>
  66. )
  67. }
  68. return null
  69. }
  70. export default FeatureIcon