import React from 'react'
import PropTypes from 'prop-types'
import RTypography from 'material-ui/Typography'

class Typography extends React.Component {
  render () {
    let props = {...this.props}
    if (props.inherit) {
      props.style = { color: 'inherit', ...props.style }
    }
    delete props.inherit
    return (
      <RTypography {...props}>
        {this.props.children}
      </RTypography>
    )
  }
}

Typography.propTypes = {
  inherit: PropTypes.any,
  children: PropTypes.any
}

export default Typography
