import { useLocale } from "@calcom/lib/hooks/useLocale"; import showToast from "@calcom/lib/notification"; import { trpc } from "@calcom/trpc/react"; import Button from "@calcom/ui/Button"; import Badge from "@components/ui/Badge"; const DisableUserImpersonation = ({ disableImpersonation }: { disableImpersonation: boolean }) => { const utils = trpc.useContext(); const { t } = useLocale(); const mutation = trpc.useMutation("viewer.updateProfile", { onSuccess: async () => { showToast(t("your_user_profile_updated_successfully"), "success"); await utils.invalidateQueries(["viewer.me"]); }, async onSettled() { await utils.invalidateQueries(["viewer.public.i18n"]); }, }); return ( <>

{t("user_impersonation_heading")}

{!disableImpersonation ? t("enabled") : t("disabled")}

{t("user_impersonation_description")}

); }; export default DisableUserImpersonation;