Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
)}
);
};
BadgeOperatorOverlay.propTypes = {
id: PropTypes.string.isRequired,
onClick: PropTypes.func,
onChangeOverlay: PropTypes.func,
onHideOverlay: PropTypes.func,
opened: PropTypes.bool,
operatorIconName: PropTypes.string,
operatorLabel: PropTypes.string,
operators: operatorsPropTypes.isRequired,
size: PropTypes.oneOf(Object.values(Badge.SIZES)),
};
// eslint-disable-next-line import/prefer-default-export
export { BadgeOperatorOverlay };
/>
);
};
BadgeFaceted.propTypes = {
badgeId: PropTypes.string.isRequired,
labelCategory: PropTypes.string.isRequired,
children: PropTypes.func.isRequired,
id: PropTypes.string.isRequired,
initialOperatorOpened: PropTypes.bool,
initialValueOpened: PropTypes.bool,
labelValue: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string)]),
operator: operatorPropTypes.isRequired,
operators: operatorsPropTypes.isRequired,
size: PropTypes.oneOf(Object.values(Badge.SIZES)),
value: PropTypes.any,
t: PropTypes.func.isRequired,
};
// eslint-disable-next-line import/prefer-default-export
export { BadgeFaceted };
if (onClick) {
onClick(event, name, setOverlayOpened);
}
};
const onHide = event => {
if (onHideOverlay) {
onHideOverlay(event);
}
};
return (
<div>
{setOverlayOpened => (
</div>
const BadgeFaceted = ({
badgeId,
children,
id,
labelCategory,
labelValue,
initialOperatorOpened,
initialValueOpened,
operator,
operators,
value,
size = Badge.SIZES.large,
t,
}) => {
const [
overlayState,
overlayDispatch,
onChangeOperatorOverlay,
onChangeValueOverlay,
] = useBadgeOverlayFlow(initialOperatorOpened, initialValueOpened);
const { dispatch } = useBadgeFacetedContext();
const [badgeOperator, setBadgeOperator] = useState(operator);
const [badgeValue, setBadgeValue] = useState(value);
const onChangeOperator = (_, operatorName) => {
const foundOperator = operators.find(findOperatorByName(operatorName));
if (foundOperator) {
const onClickRow = setOverlayOpened => (event, name) => {
if (onClick) {
onClick(event, name, setOverlayOpened);
}
};
const onHide = event => {
if (onHideOverlay) {
onHideOverlay(event);
}
};
return (
<div>
{setOverlayOpened => (
</div>