UNPKG

@talend/react-components

Version:
38 lines 1.04 kB
import PropTypes from 'prop-types'; import { useListContext } from '../context'; import { jsx as _jsx } from "react/jsx-runtime"; function ItemsNumber(props) { const { id, totalItems, selected, label, labelSelected } = props; const { t } = useListContext(); return /*#__PURE__*/_jsx("div", { className: "tc-items-number", id: id, children: selected ? labelSelected || t('LIST_TOOLBAR_NUMBER_OF_SELECTED_ITEMS', { defaultValue: '{{count}}/{{total}} item', defaultValue_other: '{{count}}/{{total}} items', count: selected, total: totalItems }) : label || t('LIST_TOOLBAR_TOTAL_NUMBER_OF_ITEMS', { defaultValue: '{{count}} item', defaultValue_other: '{{count}} items', count: totalItems }) }); } ItemsNumber.propTypes = { id: PropTypes.string, selected: PropTypes.number, totalItems: PropTypes.number, label: PropTypes.string, labelSelected: PropTypes.string }; export default ItemsNumber; //# sourceMappingURL=ItemsNumber.component.js.map