hermes-agent-features/ui-tui/src/components/commandPalette.tsx
2026-04-03 20:14:57 -05:00

24 lines
545 B
TypeScript

import { Box, Text } from 'ink'
import type { Theme } from '../theme.js'
export function CommandPalette({ matches, t }: { matches: [string, string][]; t: Theme }) {
if (!matches.length) {
return null
}
return (
<Box flexDirection="column" marginBottom={1}>
{matches.map(([cmd, desc], i) => (
<Text key={`${i}-${cmd}`}>
<Text bold color={t.color.amber}>
{cmd}
</Text>
{desc ? <Text color={t.color.dim}> {desc}</Text> : null}
</Text>
))}
</Box>
)
}