import { h } from 'preact'; import PropTypes from 'prop-types'; import { SingleListing } from '../singleListing/SingleListing'; import NextPageButton from './NextPageButton'; const AllListings = ({ listings, onAddTag, onChangeCategory, currentUserId, onOpenModal, showNextPageButton, loadNextPage, }) => { return (
{listings.map((listing) => ( ))}
{showNextPageButton && }
); }; AllListings.propTypes = { currentUserId: PropTypes.number, listings: PropTypes.isRequired, onAddTag: PropTypes.func.isRequired, onChangeCategory: PropTypes.func.isRequired, onOpenModal: PropTypes.func.isRequired, showNextPageButton: PropTypes.bool.isRequired, loadNextPage: PropTypes.func.isRequired, }; AllListings.defaultProps = { currentUserId: null, }; export default AllListings;