mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-26 01:01:40 +00:00
feat: split apart main.tsx
This commit is contained in:
parent
2818dd8611
commit
bbba9ed4f2
16 changed files with 1710 additions and 1653 deletions
25
ui-tui/src/components/commandPalette.tsx
Normal file
25
ui-tui/src/components/commandPalette.tsx
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
import { Box, Text } from 'ink'
|
||||
|
||||
import { COMMANDS } from '../constants.js'
|
||||
import type { Theme } from '../theme.js'
|
||||
|
||||
export function CommandPalette({ filter, t }: { filter: string; t: Theme }) {
|
||||
const matches = COMMANDS.filter(([cmd]) => cmd.startsWith(filter))
|
||||
|
||||
if (!matches.length) {
|
||||
return null
|
||||
}
|
||||
|
||||
return (
|
||||
<Box flexDirection="column">
|
||||
{matches.map(([cmd, desc]) => (
|
||||
<Text key={cmd}>
|
||||
<Text bold color={t.color.amber}>
|
||||
{cmd}
|
||||
</Text>
|
||||
<Text color={t.color.dim}> — {desc}</Text>
|
||||
</Text>
|
||||
))}
|
||||
</Box>
|
||||
)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue