* Create a lead component * Update to remove markdown-body from Lead, copy over <code> styles * ...so I can read the test output * Update Lead.tsx * Update Lead.tsx
22 lines
584 B
TypeScript
22 lines
584 B
TypeScript
import { ReactNode } from 'react'
|
|
import cx from 'classnames'
|
|
import styles from './Lead.module.scss'
|
|
|
|
export type LeadPropsT = {
|
|
children: string | ReactNode
|
|
className?: string
|
|
as?: keyof JSX.IntrinsicElements
|
|
}
|
|
|
|
export function Lead({ children, className, as: Component = 'div', ...restProps }: LeadPropsT) {
|
|
return (
|
|
<Component
|
|
className={cx('f2 color-text-secondary mb-3', styles.container, className)}
|
|
{...restProps}
|
|
{...(typeof children === 'string'
|
|
? { dangerouslySetInnerHTML: { __html: children } }
|
|
: { children })}
|
|
/>
|
|
)
|
|
}
|