(label: string, format: (text: string) => string)
| 84 | } |
| 85 | |
| 86 | const computeLabel = (label: string, format: (text: string) => string) => { |
| 87 | if (!label.includes('\n')) { |
| 88 | return format(label); |
| 89 | } |
| 90 | return label |
| 91 | .split('\n') |
| 92 | .map((line) => format(line)) |
| 93 | .join('\n'); |
| 94 | }; |
| 95 | |
| 96 | export const select = <Value>(opts: SelectOptions<Value>) => { |
| 97 | const opt = ( |