import { observer } from "mobx-react"; import { SettingsIcon } from "outline-icons"; import * as React from "react"; import { Trans, useTranslation } from "react-i18next"; import { toast } from "sonner"; import { languageOptions } from "@shared/i18n"; import { TeamPreference, UserPreference } from "@shared/types"; import Button from "~/components/Button"; import Heading from "~/components/Heading"; import InputSelect from "~/components/InputSelect"; import Scene from "~/components/Scene"; import Switch from "~/components/Switch"; import Text from "~/components/Text"; import useCurrentTeam from "~/hooks/useCurrentTeam"; import useCurrentUser from "~/hooks/useCurrentUser"; import useStores from "~/hooks/useStores"; import UserDelete from "../UserDelete"; import SettingRow from "./components/SettingRow"; function Preferences() { const { t } = useTranslation(); const { dialogs } = useStores(); const user = useCurrentUser(); const team = useCurrentTeam(); const handlePreferenceChange = (inverted = false) => async (ev: React.ChangeEvent) => { user.setPreference( ev.target.name as UserPreference, inverted ? !ev.target.checked : ev.target.checked ); await user.save(); toast.success(t("Preferences saved")); }; const handleLanguageChange = async (language: string) => { await user.save({ language }); toast.success(t("Preferences saved")); }; const showDeleteAccount = () => { dialogs.openModal({ title: t("Delete account"), content: , isCentered: true, }); }; return ( }> {t("Preferences")} Manage settings that affect your personal experience. {t("Display")} Choose the interface language. Community translations are accepted though our{" "} translation portal . } > {t("Behavior")} {t("Danger")} ); } export default observer(Preferences);