Files
codex/codex-cli/src/components/vendor/ink-select/select-option.js
Ilan Bigio 59a180ddec Initial commit
Signed-off-by: Ilan Bigio <ilan@openai.com>
2025-04-16 12:56:08 -04:00

28 lines
659 B
JavaScript

import React from "react";
import { Box, Text } from "ink";
import figures from "figures";
import { styles } from "./theme";
export function SelectOption({ isFocused, isSelected, children }) {
return React.createElement(
Box,
{ ...styles.option({ isFocused }) },
isFocused &&
React.createElement(
Text,
{ ...styles.focusIndicator() },
figures.pointer,
),
React.createElement(
Text,
{ ...styles.label({ isFocused, isSelected }) },
children,
),
isSelected &&
React.createElement(
Text,
{ ...styles.selectedIndicator() },
figures.tick,
),
);
}