import PropTypes from 'prop-types'; import React from 'react'; import { icons, kinds } from 'Helpers/Props'; import LegendItem from './LegendItem'; import LegendIconItem from './LegendIconItem'; import styles from './Legend.css'; function Legend(props) { const { showCutoffUnmetIcon, colorImpairedMode } = props; const iconsToShow = []; if (showCutoffUnmetIcon) { iconsToShow.push( ); } return (
{iconsToShow[0]}
{ iconsToShow.length > 1 &&
{iconsToShow[1]} {iconsToShow[2]}
}
); } Legend.propTypes = { showCutoffUnmetIcon: PropTypes.bool.isRequired, colorImpairedMode: PropTypes.bool.isRequired }; export default Legend;