import { useEffect, useRef } from 'react'; interface ExpandedPromptEditorProps { promptInput: string; onPromptChange: (value: string) => void; onSubmit: (e: React.FormEvent) => void; onClose: () => void; disabled: boolean; placeholder: string; isProcessing: boolean; isAborting: boolean; onCancel: () => void; } export default function ExpandedPromptEditor({ promptInput, onPromptChange, onSubmit, onClose, disabled, placeholder, isProcessing, isAborting, onCancel, }: ExpandedPromptEditorProps) { const textareaRef = useRef(null); // Auto-focus the textarea on mount useEffect(() => { textareaRef.current?.focus(); }, []); const handleKeyDown = (e: React.KeyboardEvent) => { // Escape closes the editor if (e.key === 'Escape') { e.preventDefault(); onClose(); return; } // Ctrl+Enter or Cmd+Enter submits the prompt if (e.key === 'Enter' && (e.ctrlKey || e.metaKey)) { e.preventDefault(); if (!disabled && promptInput.trim()) { onSubmit(e); } return; } // Regular Enter inserts a newline (default textarea behavior) // No special handling needed — this is the key difference from the simple prompt bar }; const handleSubmitClick = (e: React.FormEvent) => { e.preventDefault(); if (!disabled && promptInput.trim()) { onSubmit(e); } }; return (
{/* Left Sidebar — Tools */}
{/* Sidebar Header */}
Tools
{/* Sidebar Content — Placeholder for future tools */}
Snippets

Quick text snippets for common prompt patterns

Prompt Library

Saved and shared prompt templates

More tools coming soon...

{/* Main Editor Area */}
{/* Header Bar */}
Prompt Editor
{isProcessing ? ( ) : ( )}
{/* Textarea */}