import { useEffect, useRef } from "react"; import { Text } from "@mantine/core"; interface Props { lines: string[]; } export function ConsolePanel({ lines }: Props) { const endRef = useRef(null); // Auto-scroll to bottom as lines arrive useEffect(() => { endRef.current?.scrollIntoView({ behavior: "auto", block: "end" }); }, [lines.length]); return (
{lines.length === 0 ? ( Console output will appear here once a run starts… ) : ( lines.map((line, i) => (
{line}
)) )}
); }