"use client"; import { sdkActionManager } from "@calcom/embed-core/embed-iframe"; import { isCancellationReasonRequired } from "@calcom/features/bookings/lib/cancellationReason"; import { shouldChargeNoShowCancellationFee } from "@calcom/features/bookings/lib/payment/shouldChargeNoShowCancellationFee"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import { useRefreshData } from "@calcom/lib/hooks/useRefreshData"; import type { CancellationReasonRequirement } from "@calcom/prisma/enums"; import type { RecurringEvent } from "@calcom/types/Calendar"; import classNames from "@calcom/ui/classNames"; import { Button } from "@calcom/ui/components/button"; import { CheckboxField, Label, Select, TextArea } from "@calcom/ui/components/form"; import { showToast } from "@calcom/ui/components/toast"; import { InfoIcon, XIcon } from "@coss/ui/icons"; import { useCallback, useState } from "react"; interface InternalNotePresetsSelectProps { internalNotePresets: { id: number; name: string }[]; onPresetSelect: ( option: { value: number | string; label: string; } | null ) => void; setCancellationReason: (reason: string) => void; } const InternalNotePresetsSelect = ({ internalNotePresets, onPresetSelect, setCancellationReason, }: InternalNotePresetsSelectProps) => { const { t } = useLocale(); const [showOtherInput, setShowOtherInput] = useState(false); if (!internalNotePresets?.length) { return null; } const handleSelectChange = (option: { value: number | string; label: string } | null) => { if (option?.value === "other") { setShowOtherInput(true); setCancellationReason(""); } else { setShowOtherInput(false); onPresetSelect?.(option); } }; return (