"use client";
import { j as o } from "../../../node_modules/.pnpm/react@19.1.0/node_modules/react/jsx-runtime.mjs";
import { useState as j } from "react";
import i from "../../../node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.mjs";
import B from "../Button/index.mjs";
import r from "./FAQ.module.scss.mjs";
import S from "./components/FAQItem/index.mjs";
const d = 3;
function v({
  classNames: t,
  faqList: n = [],
  description: x = "",
  i18n: u = {
    title: "FAQs",
    seeLessButtonText: "See less",
    seeMoreButtonText: "See more"
  }
}) {
  const [e, h] = j(!1), f = e ? n : n.slice(0, d);
  return /* @__PURE__ */ o.jsxs(
    "div",
    {
      className: i(r.container, t == null ? void 0 : t.root),
      ...e ? {
        style: {
          overflowY: e && "auto"
        }
      } : {},
      children: [
        /* @__PURE__ */ o.jsx("h1", { className: i(r.title, t == null ? void 0 : t.title), children: u.title }),
        x ? /* @__PURE__ */ o.jsx("div", { className: i(r.description, t == null ? void 0 : t.description), children: x }) : null,
        f.map((p, A) => /* @__PURE__ */ o.jsx(
          S,
          {
            ...p,
            classNames: {
              root: t == null ? void 0 : t.item,
              container: t == null ? void 0 : t.itemContainer,
              title: t == null ? void 0 : t.itemTitle,
              description: t == null ? void 0 : t.itemDescription
            }
          },
          A
        )),
        n.length > d && /* @__PURE__ */ o.jsx(
          B,
          {
            className: i(r.seeMoreButton, t == null ? void 0 : t.seeMoreButton),
            type: "link",
            onClick: () => h((p) => !p),
            htmlType: "button",
            children: e ? u.seeLessButtonText : u.seeMoreButtonText
          }
        )
      ]
    }
  );
}
export {
  v as default
};
//# sourceMappingURL=index.mjs.map
