UNPKG

@anoki/fse-ui

Version:

FSE UI components library

114 lines (113 loc) 3.5 kB
import { j as o } from "./index.es180.js"; import { Section as l } from "./index.es46.js"; import { clsx as f } from "./index.es182.js"; import './sections/Services/Services.css';/* empty css */ import { useMemo as j } from "react"; import { l as a } from "./index.es184.js"; import { Col as m } from "./index.es10.js"; import { ArrowLink as v } from "./index.es35.js"; import { CardCategory as g } from "./index.es26.js"; const e = { LayoutOne: "LayoutOne", LayoutTwo: "LayoutTwo", LayoutThree: "LayoutThree", LayoutFour: "LayoutFour" }, _ = ({ title: i, description: y, goToLabel: L, href: p, asLink: h = "a", items: s, layout: n = e.LayoutOne, className: x }) => { const d = ((r) => { switch (r) { case e.LayoutOne: return "ui-service-items-layout-one"; case e.LayoutTwo: return "ui-service-items-layout-two"; case e.LayoutThree: return "ui-service-items-layout-three"; case e.LayoutFour: return "ui-service-items-layout-four"; default: return ""; } })(n), t = j(() => { switch (n) { /** * In this layout, we remove the image from all items. */ case e.LayoutOne: return s.map((r) => ({ ...a.omit(r, ["image"]) })); /** * In this layout, we remove the image from all items except the second one. */ case e.LayoutTwo: return s.map((r, u) => { const c = u !== 1; return { ...a.omit(r, c ? ["image"] : []) }; }); /** * In this layout, we remove the image from all items. */ case e.LayoutThree: return s.map((r) => ({ ...a.omit(r, ["image"]) })); /** * In this layout, we remove the image from all items. */ case e.LayoutFour: return s.map((r, u) => { const c = u !== 0; return { ...a.omit(r, c ? ["image"] : []) }; }); default: return s; } }, [s, n]); return /* @__PURE__ */ o.jsxs(l, { className: f("base-col ui-service-items-section", x), children: [ /* @__PURE__ */ o.jsxs(m, { className: "ui-service-items-sectirron-content", children: [ /* @__PURE__ */ o.jsxs("div", { className: "ui-service-items-section-title", children: [ /* @__PURE__ */ o.jsx(l.Title, { fs: "2", mdFs: "2", as: "h3", color: "slate-20", children: i }), L && p && /* @__PURE__ */ o.jsx(v, { href: p, asLink: h, fs: "7", children: L.toUpperCase() }) ] }), y && /* @__PURE__ */ o.jsx(l.Description, { children: y }) ] }), /* @__PURE__ */ o.jsx( "ul", { role: "list", "aria-label": `Lista di ${i}`, className: `list-style-none ${d}`, children: t == null ? void 0 : t.map((r) => /* @__PURE__ */ o.jsx("li", { children: /* @__PURE__ */ o.jsx( g, { title: r == null ? void 0 : r.name, description: r == null ? void 0 : r.description, image: r == null ? void 0 : r.image, href: (r == null ? void 0 : r.link) || (r == null ? void 0 : r.externalLink), showIcon: r == null ? void 0 : r.externalLink, asLink: h, isExternal: r == null ? void 0 : r.externalLink }, r._id ) }, r._id)) } ) ] }); }; export { e as SERVICES_LAYOUTS, _ as Services }; //# sourceMappingURL=index.es108.js.map