First pass at pulling the v1.5 CLI, TUI, and Launcher clients into v2.
This commit is contained in:
parent
d5f12b2a82
commit
467b01edd6
1 changed files with 24043 additions and 203 deletions
22
clients/tui/src/components/SelectableItem.tsx
Normal file
22
clients/tui/src/components/SelectableItem.tsx
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
import React from "react";
|
||||
import { Box, Text } from "ink";
|
||||
|
||||
/** Renders a selectable item: ▶ + space when selected, space + space when not. Fixed width to prevent layout shift. */
|
||||
export function SelectableItem({
|
||||
isSelected,
|
||||
bold,
|
||||
children,
|
||||
}: {
|
||||
isSelected: boolean;
|
||||
bold?: boolean;
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<Box flexShrink={0} flexDirection="row">
|
||||
<Box width={2}>
|
||||
<Text bold={bold}>{isSelected ? "▶ " : " "}</Text>
|
||||
</Box>
|
||||
<Text bold={bold}>{children}</Text>
|
||||
</Box>
|
||||
);
|
||||
}
|
||||
Loading…
Reference in a new issue