import { marked } from "marked";
// import sanitizeHtml from "sanitize-html";
class Card extends React.Component {
  constructor(props) {
    super(props);
  }
  render() {
    const { blog } = this.props;

    const sanitized = marked(blog.description);
    return (
      <div className="card">
        <div className="card-body">
          <h5 className="card-title">{blog.title}</h5>
          {/* <p className="card-text">{blog.description}</p> */}
          <p
            className="card-text"
            dangerouslySetInnerHTML={{ __html: sanitized }}
          ></p>
          <div className="card-footer">
            {blog.topics ? <span className="">{blog.topics}</span> : <p></p>}
          </div>
        </div>
      </div>
    );
  }
}
export default Card;
