ol-card.tsx 531 B

123456789101112131415161718192021222324
  1. import { Card } from 'react-bootstrap'
  2. import { FC } from 'react'
  3. type OLCardProps = {
  4. children:
  5. | React.ReactNode
  6. | ((Component: typeof Card.Body) => React.ReactElement)
  7. className?: string
  8. 'data-testid'?: string
  9. }
  10. const OLCard: FC<OLCardProps> = ({ children, className, ...rest }) => {
  11. return (
  12. <Card className={className} {...rest}>
  13. {typeof children === 'function' ? (
  14. children(Card.Body)
  15. ) : (
  16. <Card.Body>{children}</Card.Body>
  17. )}
  18. </Card>
  19. )
  20. }
  21. export default OLCard