import { CheckIcon } from "@heroicons/react/outline";
import { ArrowLeftIcon } from "@heroicons/react/solid";
import { useSession } from "next-auth/react";
import { useRouter } from "next/router";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import Button from "@calcom/ui/Button";
import { HeadSeo } from "@components/seo/head-seo";
export default function CancelSuccess() {
const { t } = useLocale();
// Get router variables
const router = useRouter();
const { title, name, eventPage, recurring } = router.query;
let team: string | string[] | number | undefined = router.query.team;
const { data: session, status } = useSession();
const isRecurringEvent = recurring === "true" ? true : false;
const loading = status === "loading";
// If team param passed wrongly just assume it be a non team case.
if (team instanceof Array || typeof team === "undefined") {
team = 0;
}
const isTeamEvent = +team === 1;
// FIXME: In case of Dynamic Event Booking, it takes the booker to one of the user's page(e.g. A) in the dynamic group(A+B+...). Booker should be taken to the same dynamic group
// This isn't directly possible because a booking doesn't know if it was done for a Dynamic Event(booking.eventType is null)
const eventUrl = `/${isTeamEvent ? "team/" : ""}${eventPage as string}`;
return (