AppModeLabel.tsx 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. 'use client'
  2. import { useTranslation } from 'react-i18next'
  3. import { type AppMode } from '@/types/app'
  4. import {
  5. AiText,
  6. CuteRobote,
  7. } from '@/app/components/base/icons/src/vender/solid/communication'
  8. import { BubbleText } from '@/app/components/base/icons/src/vender/solid/education'
  9. export type AppModeLabelProps = {
  10. mode: AppMode
  11. isAgent?: boolean
  12. className?: string
  13. }
  14. const AppModeLabel = ({
  15. mode,
  16. isAgent,
  17. className,
  18. }: AppModeLabelProps) => {
  19. const { t } = useTranslation()
  20. return (
  21. <div className={`inline-flex items-center px-2 h-6 rounded-md border border-gray-100 text-xs text-gray-500 ${className}`}>
  22. {
  23. mode === 'completion' && (
  24. <>
  25. <AiText className='mr-1 w-3 h-3 text-gray-400' />
  26. {t('app.newApp.completeApp')}
  27. </>
  28. )
  29. }
  30. {
  31. mode === 'chat' && !isAgent && (
  32. <>
  33. <BubbleText className='mr-1 w-3 h-3 text-gray-400' />
  34. {t('appDebug.assistantType.chatAssistant.name')}
  35. </>
  36. )
  37. }
  38. {
  39. mode === 'chat' && isAgent && (
  40. <>
  41. <CuteRobote className='mr-1 w-3 h-3 text-gray-400' />
  42. {t('appDebug.assistantType.agentAssistant.name')}
  43. </>
  44. )
  45. }
  46. </div>
  47. )
  48. }
  49. export default AppModeLabel