import PropTypes from 'prop-types'; import { h } from 'preact'; export const SingleListing = ({listing, onAddTag, currentUserId, onChangeCategory, onOpenModal, isOpen}) => { const tagLinks = listing.tag_list.map(tag => ( onAddTag(e, tag)} data-no-instant>{tag} )); const editButton = currentUserId === listing.user_id ? ・edit : ・report abuse; const definedClass = isOpen ? 'single-classified-listing single-classified-listing--opened' : 'single-classified-listing'; const listingCard = () => { return(
) } return ( listingCard() ); } SingleListing.propTypes = { listing: PropTypes.object.isRequired, onAddTag: PropTypes.func.isRequired, onOpenModal: PropTypes.func.isRequired, onChangeCategory: PropTypes.func.isRequired, isOpen: PropTypes.bool.isRequired, currentUserId: PropTypes.number, };