import { MutableRefObject, useRef, useState } from "react"; import REPLInput from "./REPLInput"; import REPLHistory from "./REPLHistory"; import styles from "../../styles/REPL/REPLComplete.module.css"; import type { NextPage } from "next"; interface IREPLProps { inputRef: MutableRefObject; modalManipulation: { setModalVisible: CallableFunction; setModalProject: CallableFunction; } } const REPL: NextPage = ({ inputRef, modalManipulation }) => { const [history, manipulateHistory] = useState([]); const onCommandExecuted = (result: string[]) => manipulateHistory(result.reverse().concat(history).slice(0, 1000)); const onClearHistory = () => manipulateHistory([]); const focusInput = () => { if (inputRef.current) inputRef.current.focus(); }; return (
); }; export default REPL;