({
style,
className = '',
variant = 'body',
children,
}: Props)
| 20 | } |
| 21 | |
| 22 | export const Text = ({ |
| 23 | style, |
| 24 | className = '', |
| 25 | variant = 'body', |
| 26 | children, |
| 27 | }: Props) => { |
| 28 | const componentsMap: { |
| 29 | [P in Variant]: ComponentType<any> | string |
| 30 | } = { |
| 31 | h1: 'h1', |
| 32 | h2: 'h2', |
| 33 | body: 'p', |
| 34 | description: 'p', |
| 35 | smallText: 'small', |
| 36 | } |
| 37 | const Component: ComponentType<any> | string = componentsMap[variant] |
| 38 | |
| 39 | return ( |
| 40 | <Component className={clsx(variants[variant], className)} style={style}> |
| 41 | {children} |
| 42 | </Component> |
| 43 | ) |
| 44 | } |
nothing calls this directly
no outgoing calls
no test coverage detected