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

{t("user_impersonation_heading")}

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

{t("user_impersonation_description")}

); }; export default DisableUserImpersonation;