summaryrefslogtreecommitdiff
path: root/opendc-web/opendc-web-ui/src/components/app/sidebars/topology/NameComponent.js
blob: b8c880032ac98ada10c11b7e146862dce35d922b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import PropTypes from 'prop-types'
import React from 'react'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { faPencilAlt } from '@fortawesome/free-solid-svg-icons'

const NameComponent = ({ name, onEdit }) => (
    <h2>
        {name}
        <button className="btn btn-outline-secondary float-right" onClick={onEdit}>
            <FontAwesomeIcon icon={faPencilAlt} />
        </button>
    </h2>
)

NameComponent.propTypes = {
    name: PropTypes.string,
    onEdit: PropTypes.func,
}

export default NameComponent