| 1 |
import './card.scss'; |
| 2 |
|
| 3 |
export default function CardImage( props ) { |
| 4 |
const image = <img src={ props.src } alt={ props.alt } className="eps-card__image" loading="lazy" />; |
| 5 |
|
| 6 |
return ( |
| 7 |
<figure className={ `eps-card__figure ${ props.className }` }> |
| 8 |
{ image } |
| 9 |
{ props.children } |
| 10 |
</figure> |
| 11 |
); |
| 12 |
} |
| 13 |
|
| 14 |
CardImage.propTypes = { |
| 15 |
className: PropTypes.string, |
| 16 |
src: PropTypes.string.isRequired, |
| 17 |
alt: PropTypes.string.isRequired, |
| 18 |
children: PropTypes.any, |
| 19 |
}; |
| 20 |
|
| 21 |
CardImage.defaultProps = { |
| 22 |
className: '', |
| 23 |
}; |
| 24 |
|