import React, { useContext } from 'react' import { ContentTree } from '@financial-times/content-tree' import { ContentProps } from '../../types' import { CarouselCardHeadingLevelContext } from '../Carousel' // required for items with nested external items that need to resolve assets interface CarouselCardProps extends ContentProps {} /** * Renders a CarouselCard component */ const CarouselCard: React.FC> = ({ content: { id, title, copy, additionalInfo }, children, }) => { const headingLevel = useContext(CarouselCardHeadingLevelContext) const HeadingTag = headingLevel === 2 ? 'h2' : 'h3' return (
  • {title && ( {title} )} {children}

    {copy}

    {additionalInfo && (

    {additionalInfo}

    )}
  • ) } export default CarouselCard