import { useEffect, useRef } from 'react'; import Box from '@mui/material/Box'; import Typography from '@mui/material/Typography'; export default function TrainingLogViewer({ logs }: { logs: string[] }) { const boxRef = useRef(null); useEffect(() => { const el = boxRef.current; if (el) el.scrollTop = el.scrollHeight; }, [logs.length]); return ( TRAINING LOG {logs.length === 0 ? ( No log output yet… ) : ( logs.map((line, i) =>
{line}
) )}
); }