"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.ReadOnlyStarsRatingBar = void 0;
var _react = _interopRequireDefault(require("react"));
var _StarsRatingBarSt = require("./StarsRatingBar.st.css.js");
var _constants = require("../constants");
var _wixUiIconsCommon = require("@wix/wix-ui-icons-common");
var _StarsRatingBar = _interopRequireDefault(require("../StarsRatingBar.semanticClassNames"));
var _common = require("../utils/common");
var _jsxFileName = "/home/builduser/work/57e038ea7326c1ec/packages/wix-design-system/dist/cjs/StarsRatingBar/components/ReadOnlyStarsRatingBar.tsx";
var ReadOnlyStarsRatingBar = props => {
  var {
    dataHook,
    className,
    value = 0
  } = props;
  var sizePx = (0, _common.getStarSizePx)(props);
  return /*#__PURE__*/_react.default.createElement("div", {
    "data-hook": dataHook,
    className: (0, _StarsRatingBarSt.st)(_StarsRatingBarSt.classes.root, {
      readOnly: true
    }, className),
    __self: void 0,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 15,
      columnNumber: 5
    }
  }, /*#__PURE__*/_react.default.createElement("div", {
    role: "img",
    "aria-label": (0, _common.getRatingLabel)(props, value),
    className: _StarsRatingBarSt.classes.starsContainer,
    __self: void 0,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 19,
      columnNumber: 7
    }
  }, _constants.starValues.map(starValue => {
    var filled = value >= starValue;
    return /*#__PURE__*/_react.default.createElement("div", {
      key: starValue,
      "data-hook": filled ? _constants.dataHooks.filledStar : _constants.dataHooks.emptyStar,
      "data-index": starValue,
      className: (0, _StarsRatingBarSt.st)(_StarsRatingBarSt.classes.starContainer, _StarsRatingBar.default.button),
      __self: void 0,
      __source: {
        fileName: _jsxFileName,
        lineNumber: 28,
        columnNumber: 13
      }
    }, /*#__PURE__*/_react.default.createElement(_wixUiIconsCommon.StarFilled, {
      "aria-hidden": true,
      className: (0, _StarsRatingBarSt.st)(_StarsRatingBarSt.classes.star, {
        filled
      }, filled ? _StarsRatingBar.default.filledIcon : _StarsRatingBar.default.emptyIcon),
      size: sizePx,
      __self: void 0,
      __source: {
        fileName: _jsxFileName,
        lineNumber: 34,
        columnNumber: 15
      }
    }));
  })));
};
exports.ReadOnlyStarsRatingBar = ReadOnlyStarsRatingBar;
//# sourceMappingURL=ReadOnlyStarsRatingBar.js.map