on b516e1e help sign in
bridge/src/components/PointList.js
30 lines 731 B history raw
1import React from 'react'
2import * as lodash from 'lodash'
3import { Row } from './Base'
4import RenderedPoint from './RenderedPoint'
6const PointList = props => {
7 const { setPointCursor, routeHandler, points } = props
8 const chunks = lodash.chunk(points, 3)
10 return (
11 points.length === 0
12 ? <p>{'No points to display'}</p>
13 : lodash.map(chunks, (chunk, idx) =>
14 <Row key={ `render-row-${idx}` }>
15 {
16 lodash.map(chunk, point =>
17 <RenderedPoint
18 setPointCursor={ setPointCursor }
19 routeHandler={ routeHandler }
20 point={ point }
21 />
22 )
23 }
24 </Row>
25 )
30export default PointList