/** * WorkingIndicator shows that the agent is busy: a spinner next to a whimsical * phrase that rotates every few seconds, in the spirit of Claude's own * "Pondering…" status line. * * @example * {turnActive && } */ import { useEffect, useState } from "react"; /** The rotating status phrases; exported so tests can assert against them. */ export const workingPhrases = [ "Pondering…", "Connecting the dots…", "Brewing ideas…", "Reading between the lines…", "Sketching a plan…", "Turning gears…", "Chasing a thought…", "Polishing the answer…", ]; /** How long each phrase stays on screen, in milliseconds. */ export const phraseIntervalMs = 2500; export function WorkingIndicator() { const [index, setIndex] = useState(0); useEffect(() => { const timer = setInterval( () => setIndex((current) => (current + 1) % workingPhrases.length), phraseIntervalMs, ); return () => clearInterval(timer); }, []); return ( {workingPhrases[index]} ); }