import React, { PropsWithChildren }  from 'react'
import { ContentTree } from '@financial-times/content-tree'
import { ContentProps } from '../../types'

interface CardProps
    extends ContentProps<Omit<ContentTree.Card, 'children'>> {}

const Card: React.FC<PropsWithChildren<CardProps>> = ({
    content: { title },
    children,
}
) => {
  return (
    <div className='cp-card'>
      {title && <h4 className="cp-card__title o3-type-title-sm">{title}</h4>}
      <div className="cp-card__content o3-type-body-base">{children}</div>
    </div>
  )
}

export default Card