diff --git a/components/DeployFooter.tsx b/components/DeployFooter.tsx new file mode 100644 index 0000000..8b80e61 --- /dev/null +++ b/components/DeployFooter.tsx @@ -0,0 +1,102 @@ +import React, { useRef, useLayoutEffect } from "react"; +import { useSnapshot } from "valtio"; +import { Play, Prohibit } from "phosphor-react"; +import useStayScrolled from "react-stay-scrolled"; + +import Container from "./Container"; +import Box from "./Box"; +import LogText from "./LogText"; +import { compileCode, state } from "../state"; +import Button from "./Button"; +import Heading from "./Heading"; + +const Footer = () => { + const snap = useSnapshot(state); + const logRef = useRef(null); + const { stayScrolled /*, scrollBottom*/ } = useStayScrolled(logRef); + + useLayoutEffect(() => { + stayScrolled(); + }, [snap.logs, stayScrolled]); + + return ( + + + + DEVELOPMENT LOG + + + + {snap.logs?.map((log, index) => ( + + + {log.type}:{" "} + + {log.message} + + ))} + + + + + ); +}; + +export default Footer;