import React from 'react'
import { css } from '@emotion/css'
import PropTypes from 'prop-types'

const TextView = (props) => {
  const { content = '', marginBottom = 0 } = props

  if (!content) {
    return null
  }

  return (
    <div
      className={css`
        margin-bottom: ${marginBottom}px;
      `}
      dangerouslySetInnerHTML={{ __html: content }}
    ></div>
  )
}

TextView.propTypes = {
  content: PropTypes.string,
  marginBottom: PropTypes.number,
}

TextView.defaultProps = {
  content: '',
  marginBottom: 0,
}

export default TextView
