( props: Record<string, string | null | undefined>, jsxStyleProps: JsxStyleProps = 'all', component = 'Box', )
| 59 | * Generates a single JSX example based on jsxStyleProps setting |
| 60 | */ |
| 61 | export const generateJsxExample = ( |
| 62 | props: Record<string, string | null | undefined>, |
| 63 | jsxStyleProps: JsxStyleProps = 'all', |
| 64 | component = 'Box', |
| 65 | ): string | null => { |
| 66 | if (jsxStyleProps === 'all') { |
| 67 | return formatJsxComponent(component, props) |
| 68 | } |
| 69 | if (jsxStyleProps === 'minimal') { |
| 70 | return `<${component} css={{ ${formatProps(props)} }} />` |
| 71 | } |
| 72 | return null |
| 73 | } |
| 74 | |
| 75 | /** |
| 76 | * Generates function and JSX examples for a style property |
no test coverage detected