the prompt now displays and repeats on enter

This commit is contained in:
2025-02-04 23:55:09 -05:00
parent 1306a23ec8
commit bb7e2a4ae3
10 changed files with 101 additions and 46 deletions

View File

@ -0,0 +1,21 @@
import { TermEvents } from "./events"
import { red } from "../shell/color"
import Events from "../shell/events"
function Panic(message: string) {
return <>
<p>{red("=================================================")}</p>
<p>{red("An unexpected JavaScript error occured:")}</p>
<p>{red(message)}</p>
<p>{red("=================================================")}</p>
</>
}
export default function Shell() {
const existingPrompts = Events()
if (existingPrompts) {
return existingPrompts.map((ps1, k) => <div className="shell-prompt" key={k}>{ps1}</div>)
}
return Panic("The <main> element is missing")
}