AppModeLabel.tsx 744 B

1234567891011121314151617181920212223242526
  1. 'use client'
  2. import classNames from 'classnames'
  3. import { useTranslation } from 'react-i18next'
  4. import { type AppMode } from '@/types/app'
  5. import style from '../list.module.css'
  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