import type { SelectOption } from '@rocket.chat/fuselage'; import { AccordionItem } from '@rocket.chat/fuselage'; import { Field, FieldGroup, FieldHint, FieldLabel, FieldLink, FieldRow, Select, ToggleSwitch } from '@rocket.chat/fuselage-forms'; import { useId, useMemo } from 'react'; import { Controller, useFormContext } from 'react-hook-form'; import { useTranslation } from 'react-i18next'; const PreferencesMessagesSection = () => { const { t } = useTranslation(); const { control } = useFormContext(); const messageTimeFormatLabelId = useId(); const hideUsernamesLabelId = useId(); const hideRolesLabelId = useId(); const alsoSendThreadMessageToChannelOptions = useMemo( (): SelectOption[] => [ ['default', t('Selected_first_reply_unselected_following_replies')], ['always', t('Selected_by_default')], ['never', t('Unselected_by_default')], ], [t], ); const sendOnEnterOptions = useMemo( (): SelectOption[] => [ ['normal', t('Enter_Normal')], ['alternative', t('Enter_Alternative')], ['desktop', t('Only_On_Desktop')], ], [t], ); return ( {t('Unread_Tray_Icon_Alert')} } /> {t('Always_show_thread_replies_in_main_channel')} } /> {t('Accounts_Default_User_Preferences_showThreadsInMainChannel_Description')} {t('Also_send_thread_message_to_channel_behavior')} } /> {t('Enter_Behaviour_Description')} ); }; export default PreferencesMessagesSection;