summaryrefslogtreecommitdiff
path: root/frontend/src/components/simulations/SimulationActionButtons.js
blob: 3395cdeb9b08c87c114efb4c3de4100f72d12f32 (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
37
import PropTypes from 'prop-types'
import React from 'react'
import { Link } from 'react-router-dom'

const SimulationActionButtons = ({ simulationId, onViewUsers, onDelete }) => (
    <td className="text-right">
        <Link
            to={'/simulations/' + simulationId}
            className="btn btn-outline-primary btn-sm mr-2"
            title="Open this simulation"
        >
            <span className="fa fa-play"/>
        </Link>
        <div
            className="btn btn-outline-success btn-sm disabled mr-2"
            title="View and edit collaborators (not supported currently)"
            onClick={() => onViewUsers(simulationId)}
        >
            <span className="fa fa-users"/>
        </div>
        <div
            className="btn btn-outline-danger btn-sm"
            title="Delete this simulation"
            onClick={() => onDelete(simulationId)}
        >
            <span className="fa fa-trash"/>
        </div>
    </td>
)

SimulationActionButtons.propTypes = {
    simulationId: PropTypes.string.isRequired,
    onViewUsers: PropTypes.func,
    onDelete: PropTypes.func,
}

export default SimulationActionButtons