'use client' import { useEffect } from 'react' import { createPortal } from 'react-dom' import { AppIcon } from '@/components/ui/icons' interface LongTextDetectionPromptCopy { title: string description: string strongRecommend: string smartSplitLabel: string smartSplitBadge: string continueLabel: string continueHint: string } interface LongTextDetectionPromptProps { open: boolean copy: LongTextDetectionPromptCopy onClose: () => void onSmartSplit: () => void onContinue: () => void } export default function LongTextDetectionPrompt({ open, copy, onClose, onSmartSplit, onContinue, }: LongTextDetectionPromptProps) { useEffect(() => { if (!open) return const handleKeyDown = (event: KeyboardEvent) => { if (event.key === 'Escape') { onClose() } } window.addEventListener('keydown', handleKeyDown) return () => window.removeEventListener('keydown', handleKeyDown) }, [onClose, open]) if (!open || typeof document === 'undefined') { return null } return createPortal(
{copy.description}
{copy.strongRecommend}