import { useCallback, useState } from "react"; import { sdkActionManager } from "@calcom/embed-core/embed-iframe"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import { useRefreshData } from "@calcom/lib/hooks/useRefreshData"; import { collectPageParameters, telemetryEventTypes, useTelemetry } from "@calcom/lib/telemetry"; import type { RecurringEvent } from "@calcom/types/Calendar"; import { Button, Icon, Label, TextArea, Select } from "@calcom/ui"; 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 (