import { XIcon } from "@heroicons/react/solid"; import { useRouter } from "next/router"; import { useState } from "react"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import { RecurringEvent } from "@calcom/types/Calendar"; import { Button } from "@calcom/ui/Button"; import useTheme from "@lib/hooks/useTheme"; import { collectPageParameters, telemetryEventTypes, useTelemetry } from "@lib/telemetry"; type Props = { booking: { title?: string; uid?: string; }; profile: { name: string | null; slug: string | null; }; recurringEvent: RecurringEvent | null; team?: string | null; setIsCancellationMode: (value: boolean) => void; theme: string | null; }; export default function CancelBooking(props: Props) { const [cancellationReason, setCancellationReason] = useState(""); const { t } = useLocale(); const router = useRouter(); const { booking, profile, team } = props; const [loading, setLoading] = useState(false); const telemetry = useTelemetry(); const [error, setError] = useState(booking ? null : t("booking_already_cancelled")); const { isReady, Theme } = useTheme(props.theme); if (isReady) { return ( <> {error && (
)} {!error && (