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