"use client"; import { signOut, useSession } from "next-auth/react"; import { useRouter } from "next/navigation"; import { useEffect, useState } from "react"; import { WEBSITE_URL } from "@calcom/lib/constants"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import { Button } from "@calcom/ui"; import { Icon } from "@calcom/ui"; import type { inferSSRProps } from "@lib/types/inferSSRProps"; import PageWrapper from "@components/PageWrapper"; import AuthContainer from "@components/ui/AuthContainer"; import { getServerSideProps } from "@server/lib/auth/logout/getServerSideProps"; type Props = inferSSRProps; export function Logout(props: Props) { const [btnLoading, setBtnLoading] = useState(false); const { status } = useSession(); if (status === "authenticated") signOut({ redirect: false }); const router = useRouter(); useEffect(() => { if (props.query?.survey === "true") { router.push(`${WEBSITE_URL}/cancellation`); } // eslint-disable-next-line react-hooks/exhaustive-deps }, [props.query?.survey]); const { t } = useLocale(); const message = () => { if (props.query?.passReset === "true") return "reset_your_password"; if (props.query?.emailChange === "true") return "email_change"; return "hope_to_see_you_soon"; }; const navigateToLogin = () => { setBtnLoading(true); router.push("/auth/login"); }; return (

{t(message())}

); } Logout.PageWrapper = PageWrapper; export default Logout; export { getServerSideProps };