feat(cli): TUI complete overhaul — components, sidebar, search, branding #157
@@ -2,54 +2,19 @@ import React from 'react';
|
||||
import { Box, Text } from 'ink';
|
||||
|
||||
export interface TopBarProps {
|
||||
connected: boolean;
|
||||
connecting: boolean;
|
||||
gatewayUrl: string;
|
||||
conversationId?: string;
|
||||
modelName: string | null;
|
||||
}
|
||||
|
||||
export function TopBar({
|
||||
connected,
|
||||
connecting,
|
||||
gatewayUrl,
|
||||
conversationId,
|
||||
modelName,
|
||||
}: TopBarProps) {
|
||||
const indicator = connected ? '●' : '○';
|
||||
const indicatorColor = connected ? 'green' : connecting ? 'yellow' : 'red';
|
||||
|
||||
const statusLabel = connected ? 'connected' : connecting ? 'connecting' : 'disconnected';
|
||||
|
||||
export function TopBar({ gatewayUrl }: TopBarProps) {
|
||||
// Strip protocol for compact display
|
||||
const host = gatewayUrl.replace(/^https?:\/\//, '');
|
||||
|
||||
return (
|
||||
<Box borderStyle="single" borderColor="gray" paddingX={1} justifyContent="space-between">
|
||||
<Box>
|
||||
<Text bold color="blue">
|
||||
mosaic
|
||||
</Text>
|
||||
<Text> </Text>
|
||||
<Text color={indicatorColor}>{indicator}</Text>
|
||||
<Text dimColor> {statusLabel}</Text>
|
||||
<Text dimColor> · {host}</Text>
|
||||
</Box>
|
||||
<Box>
|
||||
{modelName && (
|
||||
<>
|
||||
<Text dimColor>model: </Text>
|
||||
<Text color="magenta">{modelName}</Text>
|
||||
<Text> </Text>
|
||||
</>
|
||||
)}
|
||||
{conversationId && (
|
||||
<>
|
||||
<Text dimColor>conv: </Text>
|
||||
<Text>{conversationId.slice(0, 8)}</Text>
|
||||
</>
|
||||
)}
|
||||
</Box>
|
||||
<Text bold color="blue">
|
||||
Mosaic Stack TUI
|
||||
</Text>
|
||||
<Text dimColor>{host}</Text>
|
||||
</Box>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user