@wix/design-system
Version:
@wix/design-system
28 lines (27 loc) • 945 B
JavaScript
;
exports.__esModule = true;
exports.getStarSizePx = exports.getRatingLabel = void 0;
var _constants = require("../constants");
var getRatingLabel = (_ref, starValue) => {
var _labelValues;
var {
labelValues
} = _ref;
return (_labelValues = labelValues == null ? void 0 : labelValues[starValue - 1]) !== null && _labelValues !== void 0 ? _labelValues : String(starValue);
};
exports.getRatingLabel = getRatingLabel;
var getStarSizePx = _ref2 => {
var {
readOnly,
size
} = _ref2;
var resolvedSize;
if (readOnly) {
resolvedSize = size !== null && size !== void 0 ? size : _constants.starRatingBarSizes.medium;
} else {
resolvedSize = size === _constants.starRatingBarSizes.medium ? _constants.starRatingBarSizes.medium : _constants.starRatingBarSizes.large;
}
return _constants.starRatingBarSizesInPx[resolvedSize];
};
exports.getStarSizePx = getStarSizePx;
//# sourceMappingURL=common.js.map