import React, { PropTypes } from 'react'; import classnames from 'classnames'; import { LinkContainer } from 'react-router-bootstrap'; import { ListGroup, ListGroupItem } from 'react-bootstrap'; import PureComponent from 'react-pure-render/component'; export default class ListJobs extends PureComponent { static displayName = 'ListJobs'; static propTypes = { handleClick: PropTypes.func, jobs: PropTypes.array }; addLocation(locale) { if (!locale) { return null; } return ( { locale } ); } renderJobs(handleClick, jobs = []) { return jobs .filter(({ isPaid, isApproved, isFilled }) => { return isPaid && isApproved && !isFilled; }) .map(({ id, company, position, isHighlighted, locale }) => { const className = classnames({ 'jobs-list': true, 'col-xs-12': true, 'jobs-list-highlight': isHighlighted }); const to = `/jobs/${id}`; return ( handleClick(id) }>

{ company } {' '} - { position }

{ this.addLocation(locale) }

); }); } render() { const { handleClick, jobs } = this.props; return ( { this.renderJobs(handleClick, jobs) } ); } }