<commit_before>
import PropTypes from 'prop-types';
import React from 'react';
import { Link } from 'react-router';
import EventRow from './EventRow';
import { PENDING, APPROVED } from '../constants/eventAttendingStatus';
import EventVolunteerRow from '../components/EventVolunteerRow';

const OrganizerDashboard = ({ data, approveEventMusician, rejectEventMusician }) => {
  const eventVolunteers = data.reduce((prev, curr) => prev.concat(curr.eventvolunteers), []);
  const awaitingVolunteers = data.filter((event) =>
    !event.eventvolunteers || !event.eventvolunteers.length
  ).map((event) => <EventRow key={event.id} event={event} />);

  const pendingEventVolunteers = eventVolunteers
    .filter(eventVolunteer => eventVolunteer.status === PENDING)
    .map(eventVolunteer => <EventVolunteerRow
      eventVolunteer={eventVolunteer}
      isCurrentlyPending
      key={eventVolunteer.id}
      approveEventMusician={approveEventMusician}
      rejectEventMusician={rejectEventMusician}
    />);

  const approvedEventVolunteers = eventVolunteers
    .filter(eventVolunteer => eventVolunteer.status === APPROVED)
    .map(eventVolunteer => <EventVolunteerRow eventVolunteer={eventVolunteer}
      key={eventVolunteer.id}
    />);

  return (
    <div className="row">
      <div className="small-10">
        <h3>Dashboard</h3>
        <Link to="/createEvent"><button className="button">Create Event</button></Link>
        <br />
        <div className="card">
          <div className="card-divider">
            <h5>Pending Request</h5>
          </div>
          <div className="card-section">
            <table>
              <tbody>
                {pendingEventVolunteers}
              </tbody>
            </table>
          </div>
        </div>
        <div className="card">
          <div className="card-divider">
            <h5>Upcoming Performances</h5>
          </div>
          <div className="card-section">
            <table>
              <tbody>
                {approvedEventVolunteers}
              </tbody>
            </table>
          </div>
        </div>
        <div>
          <h5>Waiting for volunteers</h5>
          {awaitingVolunteers}
        </div>
      </div>
    </div>
  );
};

OrganizerDashboard.propTypes = {
  data: PropTypes.arrayOf(PropTypes.shape({
    eventVolunteers: PropTypes.arrayOf(PropTypes.shape({
      id: PropTypes.number.isRequired,
      status: PropTypes.string.isRequired
    }))
  })).isRequired,
  approveEventMusician: PropTypes.func.isRequired,
  rejectEventMusician: PropTypes.func.isRequired
};

OrganizerDashboard.defaultProps = {
  data: []
};


export default OrganizerDashboard;
<commit_msg>remove button and add css class to link tag<commit_after>
import PropTypes from 'prop-types';
import React from 'react';
import { Link } from 'react-router';
import EventRow from './EventRow';
import { PENDING, APPROVED } from '../constants/eventAttendingStatus';
import EventVolunteerRow from '../components/EventVolunteerRow';

const OrganizerDashboard = ({ data, approveEventMusician, rejectEventMusician }) => {
  const eventVolunteers = data.reduce((prev, curr) => prev.concat(curr.eventvolunteers), []);
  const awaitingVolunteers = data.filter((event) =>
    !event.eventvolunteers || !event.eventvolunteers.length
  ).map((event) => <EventRow key={event.id} event={event} />);

  const pendingEventVolunteers = eventVolunteers
    .filter(eventVolunteer => eventVolunteer.status === PENDING)
    .map(eventVolunteer => <EventVolunteerRow
      eventVolunteer={eventVolunteer}
      isCurrentlyPending
      key={eventVolunteer.id}
      approveEventMusician={approveEventMusician}
      rejectEventMusician={rejectEventMusician}
    />);

  const approvedEventVolunteers = eventVolunteers
    .filter(eventVolunteer => eventVolunteer.status === APPROVED)
    .map(eventVolunteer => <EventVolunteerRow eventVolunteer={eventVolunteer}
      key={eventVolunteer.id}
    />);

  return (
    <div className="row">
      <div className="small-10">
        <h3>Dashboard</h3>
        <Link className="button" to="/createEvent">Create Event</Link>
        <br />
        <div className="card">
          <div className="card-divider">
            <h5>Pending Request</h5>
          </div>
          <div className="card-section">
            <table>
              <tbody>
                {pendingEventVolunteers}
              </tbody>
            </table>
          </div>
        </div>
        <div className="card">
          <div className="card-divider">
            <h5>Upcoming Performances</h5>
          </div>
          <div className="card-section">
            <table>
              <tbody>
                {approvedEventVolunteers}
              </tbody>
            </table>
          </div>
        </div>
        <div>
          <h5>Waiting for volunteers</h5>
          {awaitingVolunteers}
        </div>
      </div>
    </div>
  );
};

OrganizerDashboard.propTypes = {
  data: PropTypes.arrayOf(PropTypes.shape({
    eventVolunteers: PropTypes.arrayOf(PropTypes.shape({
      id: PropTypes.number.isRequired,
      status: PropTypes.string.isRequired
    }))
  })).isRequired,
  approveEventMusician: PropTypes.func.isRequired,
  rejectEventMusician: PropTypes.func.isRequired
};

OrganizerDashboard.defaultProps = {
  data: []
};


export default OrganizerDashboard;

{'fraction_non_alphanumeric': 0.1291224147568474, 'fraction_numerical': 0.003726476616359232, 'mean_word_length': 2.7174515235457064, 'pattern_counts': {'":': 0, '<': 85, '<?xml version=': 0, '>': 101, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1777989', 'n_tokens_mistral': 1602, 'n_tokens_neox': 1615, 'n_words': 284}