Codeminer42/cm42-central

View on GitHub
app/assets/javascripts/components/story/note/NotesList.jsx

Summary

Maintainability
A
0 mins
Test Coverage
import React, { Fragment } from 'react';
import Note from './Note';
import PropTypes from 'prop-types';
import NotePropTypes from '../../shapes/note';

const NotesList = ({ notes, onDelete, disabled }) => (
  <Fragment>
    {notes.map(note => (
      <Note
        key={note.id}
        note={note}
        onDelete={() => onDelete(note.id)}
        disabled={disabled}
      />
    ))}
  </Fragment>
);

NotesList.propTypes = {
  notes: PropTypes.arrayOf(NotePropTypes.isRequired),
  onDelete: PropTypes.func.isRequired,
  disabled: PropTypes.bool.isRequired,
};

export default NotesList;