import React, { ReactNode } from 'react'; import { SerializeOptions, PrismicElement } from 'easy-prismic-react'; import easyPrismicReact from '../prismic'; interface Props extends SerializeOptions { content: PrismicElement[]; context?: any; className?: string; Component?: ReactNode; } const RichText: React.FC = ({ Component, content, removeParagraphs, className, context }) => { return content ? easyPrismicReact.renderRichText(content, Component, className ? { className } : {}, { removeParagraphs }, context) : null; }; export default RichText;