import { jsx as i, jsxs as a } from "react/jsx-runtime";
import s from "../../modules/Reviews/reviews.module.css";
import { Typography as r } from "../../components/Typography/Typography.es.js";
import { RatingStars as n } from "../../components/RatingStars/RatingStars.es.js";
import { ReviewList as c } from "./components/ReviewList/ReviewList.es.js";
import { Pagination as h } from "../../components/Pagination/Pagination.es.js";
const b = ({ rating: e, reviews: m, page: l, pagesCount: t, isLoading: o, onPageChange: d }) => /* @__PURE__ */ i("section", { className: s.root, children: /* @__PURE__ */ a("div", { className: s.container, children: [
  /* @__PURE__ */ a("div", { className: s.headerContainer, children: [
    /* @__PURE__ */ i(r, { as: "h2", defaultVariant: "displaySm", mobileVariant: "headingXl", children: "Reviews" }),
    !!(e != null && e.stars) && /* @__PURE__ */ a("div", { className: s.headerRow, children: [
      /* @__PURE__ */ a(r, { defaultVariant: "headingLg", mobileVariant: "headingSm", children: [
        e.stars,
        "/5"
      ] }),
      /* @__PURE__ */ i(n, { rating: e.stars, size: "lg" }),
      !!e.totalReviews && /* @__PURE__ */ a(r, { as: "p", defaultVariant: "labelSm", emphasis: !0, weight: "regular", children: [
        e.totalReviews,
        " reviews"
      ] })
    ] })
  ] }),
  /* @__PURE__ */ a("div", { className: s.reviewsContainer, children: [
    /* @__PURE__ */ i(
      c,
      {
        reviews: m,
        page: l,
        pagesCount: t,
        isLoading: !!o,
        onPageChange: d
      }
    ),
    /* @__PURE__ */ i("div", { className: s.pagination, children: /* @__PURE__ */ i(
      h,
      {
        page: l,
        pagesCount: t,
        visiblePagesLimit: 3,
        disabled: o,
        onPageChange: d
      }
    ) })
  ] })
] }) });
export {
  b as Reviews
};
