@talend/react-components
Version:
Set of react components.
39 lines • 1.05 kB
JavaScript
import PropTypes from 'prop-types';
import getDefaultT from '../../../translate';
import { jsx as _jsx } from "react/jsx-runtime";
function ItemsNumber({
id,
totalItems,
selected,
label,
labelSelected,
t
}) {
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,
t: PropTypes.func
};
ItemsNumber.defaultProps = {
t: getDefaultT()
};
export default ItemsNumber;
//# sourceMappingURL=ItemsNumber.component.js.map