summaryrefslogtreecommitdiff
path: root/opendc-web/opendc-web-ui/src/components/projects/ProjectActionButtons.js
blob: 0725e42b496852047dd2ade1c2d84127a6502f72 (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
38
import PropTypes from 'prop-types'
import React from 'react'
import Link from 'next/link'
import { Button } from 'reactstrap'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { faPlay, faUsers, faTrash } from '@fortawesome/free-solid-svg-icons'

const ProjectActionButtons = ({ projectId, onViewUsers, onDelete }) => (
    <td className="text-right">
        <Link href={`/projects/${projectId}`}>
            <Button color="primary" outline size="sm" className="mr-2" title="Open this project">
                <FontAwesomeIcon icon={faPlay} />
            </Button>
        </Link>
        <Button
            color="success"
            outline
            size="sm"
            disabled
            className="mr-2"
            title="View and edit collaborators (not supported currently)"
            onClick={() => onViewUsers(projectId)}
        >
            <FontAwesomeIcon icon={faUsers} />
        </Button>
        <Button color="danger" outline size="sm" title="Delete this project" onClick={() => onDelete(projectId)}>
            <FontAwesomeIcon icon={faTrash} />
        </Button>
    </td>
)

ProjectActionButtons.propTypes = {
    projectId: PropTypes.string.isRequired,
    onViewUsers: PropTypes.func,
    onDelete: PropTypes.func,
}

export default ProjectActionButtons