client/src/components/SessionSummary.js
author ymh <ymh.work@gmail.com>
Thu, 11 Oct 2018 11:05:04 +0200
changeset 169 f98efa1bddd1
parent 168 ea92f4fe783d
child 170 7da1d5137b0b
permissions -rw-r--r--
Correct session edition

import React from 'react';
import _ from 'lodash';
import '../App.css';
import './SessionSummary.css'
import {formatTimestamp} from '../utils';

const SessionSummary = ({notes}) => (
  <ul className="list-group sticky-left">
    {notes.map((note) =>
      <li className="list-group-item border-0" key={note._id}>
          <a href={'#note-' + note._id}>
            <small className="note-time text-warning bg-success border-0 text-center">{formatTimestamp(note.startedAt)}</small>
            <small className="note-length font-weight-bold px-2 text-muted text-center">{_.words(note.plain).length} mots</small>
            <small className="note-time text-warning bg-success border-0 text-center">{formatTimestamp(note.finishedAt)}</small>
          </a>
      </li>
    )}
  </ul>
)

export default SessionSummary;