Files
smartchat/ts_cli/components.statusbar.ts
jkunz dd04edb420 feat(initial): scaffold @push.rocks/smartchat with core, CLI, and web layers
Three-layer architecture built on @push.rocks/smartagent:
- ts/ — ChatSession wrapping runAgent() with conversation state management
- ts_cli/ — ink-based terminal chat TUI (React.createElement, no JSX)
- ts_web/ — Lit web components (smartchat-window, smartchat-message, smartchat-input)
2026-03-06 23:20:12 +00:00

32 lines
1.0 KiB
TypeScript

import { React, h, Box, Text } from './plugins.js';
import type { IChatUsage } from './plugins.js';
interface IStatusBarProps {
modelName?: string;
usage: IChatUsage;
busy: boolean;
}
export function StatusBar({ modelName, usage, busy }: IStatusBarProps): React.ReactElement {
const children: React.ReactNode[] = [
h(Text, { dimColor: true, key: 'model' }, modelName ? `model: ${modelName}` : 'smartchat'),
h(Text, { dimColor: true, key: 'sep1' }, ' | '),
h(Text, { dimColor: true, key: 'tokens' }, `tokens: ${usage.totalTokens.toLocaleString()}`),
h(Text, { dimColor: true, key: 'sep2' }, ' | '),
h(Text, { dimColor: true, key: 'turns' }, `turns: ${usage.turns}`),
];
if (busy) {
children.push(
h(Text, { dimColor: true, key: 'sep3' }, ' | '),
h(Text, { color: 'yellow', key: 'thinking' }, 'thinking...'),
);
}
return h(
Box,
{ borderStyle: 'single' as const, borderTop: true, borderBottom: false, borderLeft: false, borderRight: false, paddingX: 1 },
...children,
);
}