import { useLocale } from "@calcom/lib/hooks/useLocale"; import { trpc } from "@calcom/trpc/react"; import Badge from "@calcom/ui/Badge"; import Button from "@calcom/ui/Button"; import showToast from "@calcom/ui/v2/core/notifications"; /** @deprecated Use `packages/features/ee/teams/components/DisableTeamImpersonation.tsx` */ const DisableTeamImpersonation = ({ teamId, memberId }: { teamId: number; memberId: number }) => { const { t } = useLocale(); const utils = trpc.useContext(); const query = trpc.useQuery(["viewer.teams.getMembershipbyUser", { teamId, memberId }]); const mutation = trpc.useMutation("viewer.teams.updateMembership", { onSuccess: async () => { showToast(t("your_user_profile_updated_successfully"), "success"); await utils.invalidateQueries(["viewer.teams.getMembershipbyUser"]); }, async onSettled() { await utils.invalidateQueries(["viewer.public.i18n"]); }, }); if (query.isLoading) return <>; return ( <>

{t("settings")}

{t("user_impersonation_heading")}

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

{t("team_impersonation_description")}

); }; export default DisableTeamImpersonation;