import React from 'react' import PropTypes from 'prop-types' import {MdInfoOutline, MdHighlightOff} from 'react-icons/md' export default class DocLabel extends React.Component { static propTypes = { label: PropTypes.oneOfType([ PropTypes.object, PropTypes.string ]).isRequired, fieldSpec: PropTypes.object, onToggleDoc: PropTypes.func, } constructor (props) { super(props); this.state = { open: false, } } onToggleDoc = (open) => { this.setState({ open, }, () => { if (this.props.onToggleDoc) { this.props.onToggleDoc(this.state.open); } }); } render() { const {label, fieldSpec} = this.props; const {doc} = fieldSpec || {}; if (doc) { return } else if (label) { return } else {
} } }