MathiasKandelborg/TRUE-framework

View on GitHub
components/CMS/PortableText/SimpleBlockContent.tsx

Summary

Maintainability
A
0 mins
Test Coverage
import BlockContent from '@sanity/block-content-to-react'
import { TextBlock } from 'PortableText'
import serializers from './serializers'

interface ISimpleBlockContentProps {
  blocks: TextBlock | TextBlock[]
}

const SimpleBlockContent: React.FC<ISimpleBlockContentProps> = (props) => {
  const { blocks } = props

  return (
    <BlockContent
      blocks={blocks}
      serializers={serializers}
      // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
      projectId={process.env.NEXT_PUBLIC_SANITY_PROJECT_ID!}
      dataset="production"
    />
  )
}

export default SimpleBlockContent