import React, { FC } from 'react'; import { Color, Text, Box } from 'ink'; import SelectInput, { InkSelectInputProps, ItemProps, IndicatorProps } from 'ink-select-input'; import figures from 'figures'; import { LIGHT_BLUE, Rows } from '.'; import { StringElt } from '../TruffleFlow'; const LightBlue:FC = ({ children }) => { children } function Item(props:ItemProps) { const { isSelected, label } = props; return isSelected ? ( { label } ) : ( { label } ) } function Indicator(props:IndicatorProps) { const { isSelected } = props; return ( {isSelected ? ( {figures.pointer} ) : ' '} ) } export interface SelectProps extends InkSelectInputProps { label?: StringElt | StringElt[] } export const Select:FC = (props) => { let body = ( ) if (!props.label) return body; return ( { props.label } { body } ) } export default Select;