(children: React.ReactNode)
| 52 | }); |
| 53 | |
| 54 | function getButtonBorderRadius(children: React.ReactNode) { |
| 55 | const childNodes = Children.toArray(children); |
| 56 | |
| 57 | if (childNodes.length !== 1) { |
| 58 | return undefined; |
| 59 | } |
| 60 | |
| 61 | const [child] = childNodes; |
| 62 | |
| 63 | if (!isValidElement<IconShapeProps>(child)) { |
| 64 | return undefined; |
| 65 | } |
| 66 | |
| 67 | if (child.props.round) { |
| 68 | return '50%'; |
| 69 | } |
| 70 | |
| 71 | return child.props.borderRadius ?? 0; |
| 72 | } |
| 73 | |
| 74 | function hasTextContent(children: React.ReactNode): boolean { |
| 75 | return Children.toArray(children).some(child => { |
no outgoing calls
no test coverage detected
searching dependent graphs…