import { Callout, FieldGroup, Field, FieldLabel, FieldRow, ToggleSwitch, Select } from '@rocket.chat/fuselage'; import type { SelectOption } from '@rocket.chat/fuselage'; import { ContextualbarClose, ContextualbarTitle, ContextualbarHeader, ContextualbarIcon, ContextualbarContent, ContextualbarDialog, } from '@rocket.chat/ui-client'; import type { ChangeEvent } from 'react'; import { useTranslation } from 'react-i18next'; import { useRoom } from '../../contexts/RoomContext'; export type AutoTranslateProps = { language: string; languages: SelectOption[]; handleSwitch: (e: ChangeEvent) => void; translateEnable: boolean | undefined; handleChangeLanguage: (value: string) => void; handleClose?: () => void; }; const AutoTranslate = ({ language, languages, handleSwitch, translateEnable, handleChangeLanguage, handleClose }: AutoTranslateProps) => { const { t } = useTranslation(); const room = useRoom(); return ( {t('Auto_Translate')} {handleClose && } {room.encrypted && ( {t('Automatic_translation_not_available_info')} )} {t('Automatic_Translation')} {t('Translate_to')}