import React from 'react'; import {formatPrice} from '../lib/helpers'; export default class Listings extends React.Component { onListingClick(id) { this.props.dispatch({ type: 'VIEW_LISTING_DETAILS', action: { id } }); } onMouseEnter (id) { this.props.dispatch({ type: 'ON_LISTING_MOUSE_OVER', action: { id } }); } renderListings () { const {listings = (new Map())} = this.props; const rendered = []; for(const l of listings.values()) { const {images} = l; rendered.push(