import React from 'react'
import RichText from '../RichText'
import type { IntroFragment } from '@financial-times/cp-content-pipeline-client'
import classNames from 'classnames'

const Intro: React.FC<IntroFragment> = ({ structured, source }) => {
  return (
    <div
      className={classNames(`o-topper__${source}`, {
        'o-topper__summary--body': source === 'summary',
      })}
    >
      <RichText structuredContent={structured} />
    </div>
  )
}

export default Intro
