2021-08-08 19:21:33 +00:00
|
|
|
import { CheckIcon } from "@heroicons/react/outline";
|
2021-09-22 19:52:38 +00:00
|
|
|
import { ArrowRightIcon } from "@heroicons/react/solid";
|
2022-01-07 20:23:37 +00:00
|
|
|
import { useSession } from "next-auth/react";
|
2021-09-22 19:52:38 +00:00
|
|
|
import { useRouter } from "next/router";
|
|
|
|
|
2022-03-17 13:20:49 +00:00
|
|
|
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
2022-03-16 23:36:43 +00:00
|
|
|
import Button from "@calcom/ui/Button";
|
2022-03-17 13:20:49 +00:00
|
|
|
import { Dialog, DialogContent, DialogFooter, DialogHeader } from "@calcom/ui/Dialog";
|
2021-10-13 10:49:15 +00:00
|
|
|
|
2021-09-22 19:52:38 +00:00
|
|
|
import { HeadSeo } from "@components/seo/head-seo";
|
2021-06-06 01:26:14 +00:00
|
|
|
|
2021-09-14 08:45:28 +00:00
|
|
|
export default function CancelSuccess() {
|
2021-10-13 10:49:15 +00:00
|
|
|
const { t } = useLocale();
|
2021-08-08 19:21:33 +00:00
|
|
|
// Get router variables
|
|
|
|
const router = useRouter();
|
2021-09-14 08:45:28 +00:00
|
|
|
const { title, name, eventPage } = router.query;
|
2022-01-07 20:23:37 +00:00
|
|
|
const { data: session, status } = useSession();
|
|
|
|
const loading = status === "loading";
|
2021-08-08 19:21:33 +00:00
|
|
|
return (
|
|
|
|
<div>
|
2021-10-13 10:49:15 +00:00
|
|
|
<HeadSeo
|
|
|
|
title={`${t("cancelled")} ${title} | ${name}`}
|
|
|
|
description={`${t("cancelled")} ${title} | ${name}`}
|
|
|
|
/>
|
2022-02-09 00:05:13 +00:00
|
|
|
<main className="mx-auto my-24 max-w-3xl">
|
2022-03-17 13:20:49 +00:00
|
|
|
<Dialog defaultOpen={true}>
|
|
|
|
<DialogContent
|
|
|
|
onInteractOutside={(e) => {
|
|
|
|
e.preventDefault();
|
|
|
|
}}>
|
|
|
|
<div className="mx-auto flex h-12 w-12 items-center justify-center rounded-full bg-green-100">
|
|
|
|
<CheckIcon className="h-6 w-6 text-green-600" />
|
|
|
|
</div>
|
|
|
|
<div className="mt-5 flex justify-center">
|
|
|
|
<DialogHeader title={t("cancellation_successful")} />
|
|
|
|
</div>
|
|
|
|
{!loading && !session?.user && (
|
|
|
|
<div className="-mt-6 flex justify-center">
|
|
|
|
<p className="text-center text-sm text-gray-500">{t("free_to_pick_another_event_type")}</p>
|
2021-08-08 19:21:33 +00:00
|
|
|
</div>
|
2022-03-17 13:20:49 +00:00
|
|
|
)}
|
|
|
|
<div className="flex justify-center">
|
|
|
|
<DialogFooter>
|
|
|
|
{!loading && !session?.user && <Button href={eventPage as string}>Pick another</Button>}
|
|
|
|
{!loading && session?.user && (
|
|
|
|
<Button data-testid="back-to-bookings" href="/bookings" EndIcon={ArrowRightIcon}>
|
|
|
|
{t("back_to_bookings")}
|
|
|
|
</Button>
|
|
|
|
)}
|
|
|
|
</DialogFooter>
|
2021-08-08 19:21:33 +00:00
|
|
|
</div>
|
2022-03-17 13:20:49 +00:00
|
|
|
</DialogContent>
|
|
|
|
</Dialog>
|
2021-08-08 19:21:33 +00:00
|
|
|
</main>
|
|
|
|
</div>
|
|
|
|
);
|
2021-06-06 01:26:14 +00:00
|
|
|
}
|