AppModeLabel.tsx 744 B

123456789101112131415161718192021222324252627
  1. 'use client'
  2. import classNames from 'classnames'
  3. import { useTranslation } from 'react-i18next'
  4. import style from '../list.module.css'
  5. import { type AppMode } from '@/types/app'
  6. export type AppModeLabelProps = {
  7. mode: AppMode
  8. className?: string
  9. }
  10. const AppModeLabel = ({
  11. mode,
  12. className,
  13. }: AppModeLabelProps) => {
  14. const { t } = useTranslation()
  15. return (
  16. <span className={classNames('flex items-center w-fit h-6 gap-1 px-2 text-gray-500 text-xs border border-gray-100 rounded', className)}>
  17. <span className={classNames(style.listItemFooterIcon, mode === 'chat' && style.solidChatIcon, mode === 'completion' && style.solidCompletionIcon)} />
  18. {t(`app.modes.${mode}`)}
  19. </span>
  20. )
  21. }
  22. export default AppModeLabel