// @flow import * as React from 'react'; import noop from 'lodash/noop'; import classNames from 'classnames'; type Props = { isDisabled?: boolean, isSelected?: boolean, isValid?: boolean, onRemove: Function, text: string, }; const Pill = ({ isDisabled = false, isSelected = false, isValid = true, onRemove, text }: Props) => { const styles = classNames('bdl-Pill', 'pill', { 'is-selected': isSelected && !isDisabled, 'is-invalid': !isValid, 'is-disabled': isDisabled, 'bdl-is-disabled': isDisabled, }); const onClick = isDisabled ? noop : onRemove; return ( {text} ); }; export default Pill;