@anoki/fse-ui
Version:
FSE UI components library
66 lines (65 loc) • 1.86 kB
JavaScript
import { j as o } from "./index.es237.js";
import { BaseModal as m } from "./index.es30.js";
import { CardFaqCTA as j, CardFaqCTAType as u } from "./index.es43.js";
import S from "./index.es271.js";
import { useState as a } from "react";
import { RichText as q } from "./index.es143.js";
import './sections/FaqSections/FaqSections.css';/* empty css */
import { Section as h, SectionHeading as y } from "./index.es123.js";
const E = ({
title: l,
description: i,
items: s = [],
colorTitle: n = "primary",
fontSizeTitle: p = "4"
}) => {
const [c, t] = a(!1), [r, d] = a(null), f = (e) => {
d(e), t(!0);
};
return /* @__PURE__ */ o.jsxs(h, { className: "faq-sections", children: [
/* @__PURE__ */ o.jsx(
y,
{
title: l,
color: n,
fs: p,
description: /* @__PURE__ */ o.jsx(q, { description: i }),
className: "faq-sections__title"
}
),
/* @__PURE__ */ o.jsx(
"ul",
{
role: "list",
"aria-label": `Lista di ${l}`,
className: "faq-sections__list",
children: s == null ? void 0 : s.map((e, x) => /* @__PURE__ */ o.jsx("li", { children: /* @__PURE__ */ o.jsx(
j,
{
type: e.type,
title: e.title,
description: e.description,
link: e.link ?? "",
isExternal: e.isExternal,
openModal: e.type === u.FAQ ? () => f(e) : void 0,
icon: e.icon
}
) }, e.key ?? x))
}
),
r && /* @__PURE__ */ o.jsx(m, { open: c, setOpen: t, children: /* @__PURE__ */ o.jsx(
S,
{
faq: {
question: r.title,
answer: r.description || ""
},
handleCloseModal: () => t(!1)
}
) })
] });
};
export {
E as FaqSections
};
//# sourceMappingURL=index.es161.js.map