Add buildtime as static prop

This commit is contained in:
2022-06-14 19:07:21 +02:00
parent 5708a30835
commit ce00e33338
2 changed files with 18 additions and 7 deletions

View File

@ -2,15 +2,15 @@ import { MutableRefObject, useEffect, 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";
import type { NextPage, GetStaticProps } from "next";
interface IREPLProps {
inputRef: MutableRefObject<HTMLInputElement|null>;
buildTime: string;
}
const REPL: NextPage<IREPLProps> = ({ inputRef }) => {
const date = new Date();
const [history, manipulateHistory] = useState<string[]>([`cer0 0S - ${date.toLocaleDateString()}`]);
const REPL: NextPage<IREPLProps> = ({ inputRef, buildTime }) => {
const [history, manipulateHistory] = useState<string[]>([`cer0 0S - Build ${buildTime}`]);
const containerRef = useRef<HTMLDivElement>(null);
const onCommandExecuted = (result: string[]) => manipulateHistory(result.reverse().concat(history).slice(0, 1000));
const onClearHistory = () => manipulateHistory([]);