input changes updated

This commit is contained in:
2025-03-27 10:54:56 +05:30
parent 8da8d5bf60
commit 809505ec84
6 changed files with 126 additions and 12 deletions

View File

@@ -6,9 +6,13 @@ const Panel = ({
height,
terminalOutput = [],
isRunning = false,
waitingForInput = false,
activeRunningFile = null,
initialTab = "terminal",
onClose
onClose,
userInput = "",
onUserInputChange,
onInputSubmit
}) => {
const [activeTab, setActiveTab] = useState(initialTab);
@@ -28,9 +32,22 @@ const Panel = ({
{line.type === 'command' ? <span className="terminal-prompt">$</span> : ''} {line.content}
</div>
))}
{isRunning && (
{waitingForInput && (
<div className="terminal-line">
<span className="terminal-cursor"></span>
<span className="terminal-prompt">Input:</span>
<input
type="text"
className="terminal-input"
value={userInput}
onChange={(e) => onUserInputChange && onUserInputChange(e.target.value)}
placeholder="Enter input for your program here..."
onKeyDown={(e) => {
if (e.key === 'Enter' && onInputSubmit) {
onInputSubmit();
}
}}
autoFocus
/>
</div>
)}
</>