{"size": 1088, "ext": "js", "max_stars_repo_path": "src/renderer/components/notification-section.js", "max_stars_repo_name": "questbeat/PopHub-Electron", "max_stars_repo_stars_event_min_datetime": "2016-01-09T02:05:32.000Z", "max_stars_repo_stars_event_max_datetime": "2019-05-09T06:21:07.000Z", "max_issues_repo_path": "src/renderer/components/notification-section.js", "max_issues_repo_name": "questbeat/PopHub-Electron", "max_issues_repo_issues_event_min_datetime": "2016-01-19T16:41:17.000Z", "max_issues_repo_issues_event_max_datetime": "2018-07-18T05:11:00.000Z", "max_forks_repo_path": "src/renderer/components/notification-section.js", "max_forks_repo_name": "questbeat/PopHub-Electron", "max_forks_repo_forks_event_min_datetime": "2017-06-25T19:36:16.000Z", "max_forks_repo_forks_event_max_datetime": "2020-01-31T14:28:21.000Z"}
{"max_stars_count": 42, "max_issues_count": 5, "max_forks_count": 4, "avg_line_length": 29.4054054054, "max_line_length": 91, "alphanum_fraction": 0.6829044118}
import React, { Component, PropTypes } from 'react';
import Notifications from './notifications';

export default class NotificationSection extends Component {
  render() {
    const {
      name,
      notifications,
      markNotificationsAsReadInRepository,
      onNotificationClick
    } = this.props;

    const repository = notifications[0].repository;

    return (
      <div className="notification-section">
        <div className="notification-section-title">
          <strong>{name}</strong>
          <a href="#" onClick={markNotificationsAsReadInRepository.bind(this, repository)}>
            <span className="octicon octicon-check pull-right checkmark"></span>
          </a>
        </div>
        <Notifications
          notifications={notifications}
          onNotificationClick={onNotificationClick} />
      </div>
    );
  }
}

NotificationSection.propTypes = {
  name: PropTypes.string.isRequired,
  notifications: PropTypes.array.isRequired,
  markNotificationsAsReadInRepository: PropTypes.func.isRequired,
  onNotificationClick: PropTypes.func.isRequired
};
