import classnames from 'classnames' ; import React from 'react' ; export interface TypographyProps < T > extends React . HTMLProps < T > { children ? : React . ReactNode ; className ? : string ; tag ? : string ; } interface EnhancedProps { tag : string ; classModifier : string ; } const typographyHOC = < T extends { } > ( options ) => { const { tag , classModifier } = options ; const Typography = ( { children , className = '' , tag : Tag = tag , ... otherProps } ) => { const classes = classnames ( 'mdc-typography' , `mdc-typography--${ classModifier }` , className ) ; return ( < Tag className = { classes } { ... otherProps } > { children } < /Tag>); } ; return Typography ; } ; export default typographyHOC ;