all files / src/SqlLab/components/ QueryStateLabel.jsx

100% Statements 11/11
100% Branches 0/0
100% Functions 1/1
100% Lines 9/9
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20                      
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;