Codeminer42/cm42-central

View on GitHub
app/assets/javascripts/components/stories/History/HistoryItem.jsx

Summary

Maintainability
A
1 hr
Test Coverage
import React from 'react';
import HistoryHeader from './HistoryHeader';
import HistoryChanges from './HistoryChanges';
import PropTypes from 'prop-types';

const HistoryItem = ({ title, date, user, changes }) => (
  <div className="HistoryItem">
    <HistoryHeader
      title={title}
      date={date}
      user={user}
      data-id="history-header"
    />
    <HistoryChanges data-id="history-changes" changes={changes} />
  </div>
);

HistoryItem.propTypes = {
  title: PropTypes.string.isRequired,
  date: PropTypes.string.isRequired,
  user: PropTypes.string.isRequired,
  changes: PropTypes.array.isRequired,
};

export default HistoryItem;