import { classNames } from "@calcom/lib"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import { trpc } from "@calcom/trpc/react"; import { showToast, Switch } from "@calcom/ui/v2/core"; const DisableTeamImpersonation = ({ teamId, memberId, disabled, }: { teamId: number; memberId: number; disabled: boolean; }) => { 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("team_impersonation_description")}