/* Copyright 2024 New Vector Ltd. SPDX-License-Identifier: AGPL-3.0-only Please see LICENSE in the repository root for full details. */ import { ChangeEvent, FC } from "react"; import { useTranslation } from "react-i18next"; import { Text } from "@vector-im/compound-web"; import { FieldRow, InputField } from "../input/Input"; import { showHandRaisedTimer as showHandRaisedTimerSetting, showReactions as showReactionsSetting, playReactionsSound as playReactionsSoundSetting, useSetting, } from "./settings"; export const PreferencesSettingsTab: FC = () => { const { t } = useTranslation(); const [showHandRaisedTimer, setShowHandRaisedTimer] = useSetting( showHandRaisedTimerSetting, ); const [showReactions, setShowReactions] = useSetting(showReactionsSetting); const [playReactionsSound, setPlayReactionSound] = useSetting( playReactionsSoundSetting, ); const onChangeSetting = ( e: ChangeEvent, fn: (value: boolean) => void, ): void => { fn(e.target.checked); }; return (

{t("settings.preferences_tab_h4")}

{t("settings.preferences_tab_body")} onChangeSetting(e, setShowHandRaisedTimer)} />
{t("settings.preferences_tab.reactions_title")}
onChangeSetting(e, setShowReactions)} /> onChangeSetting(e, setPlayReactionSound)} />
); };