cal.pub0.org/packages/features/ee/impersonation/components/ImpersonatingBanner.tsx

28 lines
635 B
TypeScript
Raw Normal View History

import { useSession } from "next-auth/react";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import { TopBanner } from "@calcom/ui";
2022-05-17 20:43:27 +00:00
function ImpersonatingBanner() {
const { t } = useLocale();
const { data } = useSession();
if (!data?.user.impersonatedByUID) return null;
return (
<>
<TopBanner
text={t("impersonating_user_warning", { user: data.user.username })}
variant="warning"
actions={
<a className="border-b border-b-black" href="/auth/logout">
Click Here To stop
</a>
}
/>
</>
);
}
export default ImpersonatingBanner;