import { useState } from 'react' import { X, Smile } from 'lucide-react' import clsx from 'clsx' /** * Caption style editor modal * Props: { isOpen, onClose, clipId, jobId } */ function CaptionEditor({ isOpen, onClose, clipId, jobId }) { const [style, setStyle] = useState('highlight') const [fontSize, setFontSize] = useState(48) const [textColor, setTextColor] = useState('#FFFFFF') const [highlightColor, setHighlightColor] = useState('#E8A020') const [bgColor, setBgColor] = useState('#000000') const [bgOpacity, setBgOpacity] = useState(0.5) const [position, setPosition] = useState('bottom') const [emoji, setEmoji] = useState(true) const [language, setLanguage] = useState('en') if (!isOpen) return null const styles = [ { id: 'highlight', label: 'Highlight Word', icon: '✨' }, { id: 'box', label: 'Box', icon: '📦' }, { id: 'outline', label: 'Outline', icon: '⭕' }, { id: 'bold', label: 'Bold', icon: '𝗕' }, { id: 'none', label: 'None', icon: '—' }, ] const positions = [ { id: 'top', label: 'Top', pos: 'top-4' }, { id: 'middle', label: 'Middle', pos: 'top-1/2' }, { id: 'bottom', label: 'Bottom', pos: 'bottom-4' }, ] const handleSave = () => { // Mock API call console.log({ style, fontSize, textColor, highlightColor, bgColor, bgOpacity, position, emoji, language, }) onClose() } return ( <> {/* Overlay */}
{/* Modal */}
{/* Header */}

Edit Captions

{/* Caption Style */}
{styles.map((s) => ( ))}
{/* Font Size */}
{fontSize}px
setFontSize(parseInt(e.target.value))} className="w-full h-2 bg-white/10 rounded-full accent-primary-500" />
{/* Colors */}
setTextColor(e.target.value)} className="w-16 h-10 rounded-lg cursor-pointer" /> setTextColor(e.target.value)} className="input-field flex-1 text-sm font-mono" />
setHighlightColor(e.target.value)} className="w-16 h-10 rounded-lg cursor-pointer" /> setHighlightColor(e.target.value)} className="input-field flex-1 text-sm font-mono" />
setBgColor(e.target.value)} className="w-16 h-10 rounded-lg cursor-pointer" /> setBgColor(e.target.value)} className="input-field flex-1 text-sm font-mono" />
setBgOpacity(parseFloat(e.target.value))} className="w-full h-2 bg-white/10 rounded-full accent-primary-500" />
{/* Position */}
{positions.map((p) => ( ))}
{/* Language */}
{/* Emoji Captions */} {/* Preview */}

Preview

{/* Phone frame mockup */}
{/* Caption preview */}

Sample caption text

{emoji &&

✨ 🎬 🔥

}
{/* Actions */}
) } export default CaptionEditor