summaryrefslogtreecommitdiff
path: root/frontend/src/components/experiments/ExperimentRowComponent.js
blob: 880d7e3112207eac6d373039b9796bb1be1b5786 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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.topology.name}</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.string.isRequired,
}

export default ExperimentRowComponent