1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | 1× 1× 1× 1× 1× 1× 1× 1× 1× | import React from 'react'; import PropTypes from 'prop-types'; import { Label } from 'react-bootstrap'; import { STATE_BSSTYLE_MAP } from '../constants'; const propTypes = { query: PropTypes.object.isRequired, }; export default function QueryStateLabel({ query }) { const bsStyle = STATE_BSSTYLE_MAP[query.state]; return ( <Label className="m-r-3" bsStyle={bsStyle}> {query.state} </Label> ); } QueryStateLabel.propTypes = propTypes; |