client/src/components/Note.js
author Alexandre Segura <mex.zktk@gmail.com>
Thu, 22 Jun 2017 12:37:53 +0200
changeset 78 49c5ea36d0a4
parent 74 043477fd5c5c
child 79 772b73e31069
permissions -rw-r--r--
Store margin comment.

import React from 'react';
import PropTypes from 'prop-types';
import {formatTimestamp} from '../utils';

const Note = ({note}) => {
  return (
    <div id={"note-" + note._id} className="note">
      <span className="start">{formatTimestamp(note.startedAt)}</span>
      <span className="finish">{formatTimestamp(note.finishedAt)}</span>
      <div className="note-content" dangerouslySetInnerHTML={{ __html: note.html }} />
      <div className="note-margin-comment">
        <small className="text-muted">{ note.marginComment }</small>
      </div>
    </div>
  );
};

Note.propTypes = {
  note: PropTypes.object.isRequired
};

export default Note;