import { h } from 'preact'; import PropTypes from 'prop-types'; const MainImage = ({ mainImage, onEdit }) => (
{ if (e.key === 'Enter') { onEdit(e); } }} >
); MainImage.defaultProps = { onEdit: () => {}, }; MainImage.propTypes = { mainImage: PropTypes.string.isRequired, onEdit: PropTypes.func, }; export default MainImage;