import React from 'react'; import PropTypes from "prop-types"; import { connect } from "react-redux"; import { NAME } from "../../../state"; import { SpecificBlock } from "../../../primitives/Block"; import { CheckboxResultDisplay as Checkbox } from "../../../primitives/Input"; import { Label } from "../../../primitives/Label"; import { State } from "../../../index"; function numOfMatchingItemsInObject(object: any, value: any) { const items = Object.keys(object || {}).filter( (key) => object[key] === value ); return items.length; } function Sum({ node, node: { allMandatory, currentValue = {}, errors } }: any) { const matchingItems = numOfMatchingItemsInObject(currentValue, true); return (