@prijsvrijtechsupport/ui 0.0.44 → 0.0.45

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -4136,10 +4136,18 @@ const PageRating = ({ rating, ratingsCount, text, className }) => {
4136
4136
  if (boxRating > 0) {
4137
4137
  if (roundedRating % 1 !== 0) {
4138
4138
  const halfColorIndex = Math.floor(roundedRating) * 2 - 1;
4139
- ratingColor = RATING_COLORS[Math.min(halfColorIndex, RATING_COLORS.length - 1)] || "#FB3C00";
4139
+ if (halfColorIndex >= 0 && halfColorIndex < RATING_COLORS.length && RATING_COLORS[halfColorIndex]) {
4140
+ ratingColor = RATING_COLORS[halfColorIndex];
4141
+ } else {
4142
+ ratingColor = "#FB3C00";
4143
+ }
4140
4144
  } else {
4141
4145
  const fullColorIndex = Math.floor(boxRating) * 2 - 2;
4142
- ratingColor = RATING_COLORS[Math.min(fullColorIndex, RATING_COLORS.length - 1)] || "#FB3C00";
4146
+ if (fullColorIndex >= 0 && fullColorIndex < RATING_COLORS.length && RATING_COLORS[fullColorIndex]) {
4147
+ ratingColor = RATING_COLORS[fullColorIndex];
4148
+ } else {
4149
+ ratingColor = "#FB3C00";
4150
+ }
4143
4151
  }
4144
4152
  }
4145
4153
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {