{"size": 1202, "ext": "js", "max_stars_repo_path": "src/components/experiments/ExperimentRowComponent.js", "max_stars_repo_name": "atlarge-research/opendc-frontend", "max_stars_repo_stars_event_min_datetime": "2017-03-27T17:03:17.000Z", "max_stars_repo_stars_event_max_datetime": "2018-02-25T18:02:07.000Z", "max_issues_repo_path": "src/components/experiments/ExperimentRowComponent.js", "max_issues_repo_name": "atlarge-research/opendc-frontend", "max_issues_repo_issues_event_min_datetime": "2017-03-15T09:05:50.000Z", "max_issues_repo_issues_event_max_datetime": "2018-11-28T19:11:20.000Z", "max_forks_repo_path": "src/components/experiments/ExperimentRowComponent.js", "max_forks_repo_name": "atlarge-research/opendc-frontend", "max_forks_repo_forks_event_min_datetime": "2017-11-02T08:13:13.000Z", "max_forks_repo_forks_event_max_datetime": "2017-11-02T08:13:13.000Z"}
{"max_stars_count": 3, "max_issues_count": 45, "max_forks_count": 1, "avg_line_length": 29.3170731707, "max_line_length": 77, "alphanum_fraction": 0.6247920133}
import PropTypes from "prop-types";
import React from "react";
import { Link } from "react-router-dom";
import Shapes from "../../shapes/index";

const ExperimentRowComponent = ({ experiment, simulationId, onDelete }) => (
  <tr>
    <td className="pt-3">{experiment.name}</td>
    <td className="pt-3">
      {experiment.path.name
        ? experiment.path.name
        : "Path " + experiment.path.id}
    </td>
    <td className="pt-3">{experiment.trace.name}</td>
    <td className="pt-3">{experiment.scheduler.name}</td>
    <td className="text-right">
      <Link
        to={"/simulations/" + simulationId + "/experiments/" + experiment.id}
        className="btn btn-outline-primary btn-sm mr-2"
        title="Open this experiment"
      >
        <span className="fa fa-play" />
      </Link>
      <div
        className="btn btn-outline-danger btn-sm"
        title="Delete this experiment"
        onClick={() => onDelete(experiment.id)}
      >
        <span className="fa fa-trash" />
      </div>
    </td>
  </tr>
);

ExperimentRowComponent.propTypes = {
  experiment: Shapes.Experiment.isRequired,
  simulationId: PropTypes.number.isRequired
};

export default ExperimentRowComponent;
