import { mainSymbols } from 'figures' import { Box, Text } from 'ink' import InkSelectInput, { type IndicatorProps, type ItemProps, } from 'ink-select-input' import React from 'react' export type Item = { key?: string label: string value: V } type Props = { /** * Items to display in a list. Each item must be an object and have `label` and `value` props, it may also optionally have a `key` prop. * If no `key` prop is provided, `value` will be used as the item key. */ items: Array> /** * Function to call when user selects an item. Item object is passed to that function as an argument. */ onSelect: (item: Item) => void } // rome fails if we don't do this type AnyItem = any /** * Create EVMts app step to select the use case * Uses a MultiSelect */ export const SelectInput = ({ items, onSelect, }: Props) => { const initialIndex = items.findIndex((item) => item.label.includes('(recommended)'), ) return ( -1 ? initialIndex : 0} items={items} onSelect={onSelect} /> ) } const IndicatorComponent: React.FC = ({ isSelected }) => { return ( {isSelected ? ( {mainSymbols.pointer} ) : ( )} ) } const ItemComponent: React.FC = ({ label, isSelected }) => { return {label} }