/* eslint-disable react/no-danger */

import React from "react";
import PropTypes from "prop-types";

/**
 * Rich text fills a div with the rendered output of an rich text (html) field.
 */
const RichText = ({ html }) => (
  <div dangerouslySetInnerHTML={{ __html: html }} />
);

RichText.propTypes = {
  /**
   * The HTML string generated by the rich text field
   */
  html: PropTypes.string.isRequired,
};

export default RichText;
