client/src/components/SessionSummary.js
author ymh <ymh.work@gmail.com>
Fri, 28 Jul 2017 19:40:35 +0200
changeset 129 d48946d164c6
parent 125 c653f49fabfb
child 143 cfcbf4bc66f1
permissions -rw-r--r--
Add a first version of synchronisation Remove redux-offline dependency make the redux state fully immutable TODO: better error management TODO: make syncronization work automatically

import React from 'react';
import { ListGroup, ListGroupItem } from 'react-bootstrap';
import _ from 'lodash';
import '../App.css';
import {formatTimestamp} from '../utils';

const SessionSummary = ({notes}) => (
  <ListGroup>
    {notes.map((note) =>
      <ListGroupItem key={note.get('_id')}>
        <a href={'#note-' + note.get('_id')}>
          <span className="text-muted">{formatTimestamp(note.startedAt)}  {formatTimestamp(note.finishedAt)}</span>
          <span className="pull-right">{_.words(note.plain).length} words</span>
        </a>
      </ListGroupItem>
    )}
  </ListGroup>
)

export default SessionSummary;