Files
letta-code/src/cli/components/Transcript.tsx
2025-10-24 21:19:24 -07:00

25 lines
672 B
TypeScript

import { Box, Text } from "ink";
export type Row =
| { kind: "user"; text: string; id?: string }
| { kind: "assistant"; text: string; id?: string }
| { kind: "reasoning"; text: string; id?: string };
export function Transcript({ rows }: { rows: Row[] }) {
return (
<Box flexDirection="column">
{rows.map((r, i) => {
if (r.kind === "user")
return <Text key={r.id ?? i}>{`> ${r.text}`}</Text>;
if (r.kind === "assistant")
return <Text key={r.id ?? i}>{r.text}</Text>;
return (
<Text key={r.id ?? i} dimColor>
{r.text}
</Text>
); // reasoning
})}
</Box>
);
}