import Box from "@mui/material/Box"; import Typography from "@mui/material/Typography"; import type { ChatTurn } from "./types"; import OdinMark from "./OdinMark"; interface OdinThreadProps { turns: ChatTurn[]; busy: boolean; loading: boolean; threadRef: React.RefObject; } /** Small Odin avatar shown to the left of assistant bubbles. */ function OdinAvatar({ size = 28 }: { size?: number }) { return ( O ); } export default function OdinThread({ turns, busy, loading, threadRef, }: OdinThreadProps) { return ( {/* Loading state — history is being fetched */} {loading && ( Načítám… )} {/* Empty state */} {turns.length === 0 && !busy && !loading && ( Dobrý den, jsem Odin. Zeptejte se, nebo přiložte fakturu (PDF) k importu. )} {/* Message bubbles */} {turns.map((t, i) => { const isUser = t.role === "user"; return ( {!isUser && } {/* Color MUST sit on the Typography: GlobalStyles pins `p` to text.secondary, which beats a color merely inherited from the Box. An sx class on the element wins over that element rule. */} {t.content} ); })} {/* Busy indicator */} {busy && ( Pracuji… )} ); }