| 1 |
export default function Card( { image, imageAlt, text, link, name, clickAction } ) { |
| 2 |
const onClick = () => { |
| 3 |
elementorCommon.events.dispatchEvent( { |
| 4 |
event: 'starting canvas click', |
| 5 |
version: '', |
| 6 |
details: { |
| 7 |
placement: elementorAppConfig.onboarding.eventPlacement, |
| 8 |
selection: name, |
| 9 |
}, |
| 10 |
} ); |
| 11 |
|
| 12 |
if ( clickAction ) { |
| 13 |
clickAction(); |
| 14 |
} |
| 15 |
}; |
| 16 |
|
| 17 |
return ( |
| 18 |
<a className="e-onboarding__card" href={ link } onClick={ onClick }> |
| 19 |
<img className="e-onboarding__card-image" src={ image } alt={ imageAlt } /> |
| 20 |
<div className="e-onboarding__card-text">{ text }</div> |
| 21 |
</a> |
| 22 |
); |
| 23 |
} |
| 24 |
|
| 25 |
Card.propTypes = { |
| 26 |
image: PropTypes.string.isRequired, |
| 27 |
imageAlt: PropTypes.string.isRequired, |
| 28 |
text: PropTypes.string.isRequired, |
| 29 |
link: PropTypes.string.isRequired, |
| 30 |
name: PropTypes.string.isRequired, |
| 31 |
clickAction: PropTypes.func, |
| 32 |
}; |
| 33 |
|