"use client"; import { useCallback, useState } from "react"; import { sdkActionManager } from "@calcom/embed-core/embed-iframe"; import { shouldChargeNoShowCancellationFee } from "@calcom/features/bookings/lib/payment/shouldChargeNoShowCancellationFee"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import { useRefreshData } from "@calcom/lib/hooks/useRefreshData"; import { useTelemetry } from "@calcom/lib/hooks/useTelemetry"; import { collectPageParameters, telemetryEventTypes } from "@calcom/lib/telemetry"; import type { RecurringEvent } from "@calcom/types/Calendar"; import { Button } from "@calcom/ui/components/button"; import { Label, Select, TextArea, CheckboxField } from "@calcom/ui/components/form"; import { Icon } from "@calcom/ui/components/icon"; 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 && onPresetSelect(option); } }; return (