| 14 | |
| 15 | // Extract text content from ReactNode for width calculation |
| 16 | function getTextContent(node: ReactNode): string { |
| 17 | if (typeof node === 'string') return node; |
| 18 | if (typeof node === 'number') return String(node); |
| 19 | if (!node) return ''; |
| 20 | if (Array.isArray(node)) return node.map(getTextContent).join(''); |
| 21 | if (React.isValidElement<{ |
| 22 | children?: ReactNode; |
| 23 | }>(node)) { |
| 24 | return getTextContent(node.props.children); |
| 25 | } |
| 26 | return ''; |
| 27 | } |
| 28 | type BaseOption<T> = { |
| 29 | description?: string; |
| 30 | dimDescription?: boolean; |