"use client"; import { useEffect, useRef } from "react"; interface StatusLogProps { messages: string[]; } export default function StatusLog({ messages }: StatusLogProps) { const bottomRef = useRef(null); useEffect(() => { bottomRef.current?.scrollIntoView({ behavior: "smooth" }); }, [messages]); return (

Status Log

{messages.length === 0 ? (

Waiting for input...

) : ( messages.map((msg, i) => { const isError = msg.toLowerCase().includes("error") || msg.toLowerCase().includes("failed"); const isSuccess = msg.toLowerCase().includes("done") || msg.toLowerCase().includes("complete") || msg.toLowerCase().includes("ready"); const color = isError ? "var(--error)" : isSuccess ? "var(--success)" : "var(--foreground)"; return (
{String(i + 1).padStart(2, "0")} {msg}
); }) )}
); }