"use client"; import type { ReactNode } from "react"; import { resolveLabels } from "../labels.js"; import { ACCENT_SOFT_SURFACE, TEXT_MUTED } from "../theme/tokens.js"; import { ThinkingDots } from "./ThinkingDots.js"; export interface ThinkingIndicatorLabels { thinking: string; thinkingRegion: string; } export const defaultThinkingIndicatorLabels: Readonly> = Object.freeze({ thinking: "Thinking", thinkingRegion: "Loading response", }); export interface ThinkingIndicatorProps { /** Fills the avatar circle; without it the circle stays empty (018 decision 3). */ assistantAvatar?: ReactNode; /** Overrides the indicator's strings; English defaults apply per key. */ labels?: Partial; } // The circle stays aria-hidden (noise inside role="status") and always pulses - this component is the loading state. export function ThinkingIndicator({ assistantAvatar, labels }: ThinkingIndicatorProps) { const resolved = resolveLabels(defaultThinkingIndicatorLabels, labels); return (
{resolved.thinking}
); }