| 146 | const placeholder = opts.placeholder; |
| 147 | const showPlaceholder = userInput === '' && placeholder !== undefined; |
| 148 | const opt = (option: Option<Value>, state: 'inactive' | 'active' | 'disabled') => { |
| 149 | const label = getLabel(option); |
| 150 | const hint = |
| 151 | option.hint && option.value === this.focusedValue |
| 152 | ? styleText('dim', ` (${option.hint})`) |
| 153 | : ''; |
| 154 | switch (state) { |
| 155 | case 'active': |
| 156 | return `${styleText('green', S_RADIO_ACTIVE)} ${label}${hint}`; |
| 157 | case 'inactive': |
| 158 | return `${styleText('dim', S_RADIO_INACTIVE)} ${styleText('dim', label)}`; |
| 159 | case 'disabled': |
| 160 | return `${styleText('gray', S_RADIO_INACTIVE)} ${styleText(['strikethrough', 'gray'], label)}`; |
| 161 | } |
| 162 | }; |
| 163 | |
| 164 | // Handle different states |
| 165 | switch (this.state) { |