@anoki/fse-ui
Version:
FSE UI components library
99 lines (98 loc) • 3.29 kB
JavaScript
import { j as r } from "./index.es244.js";
import { Section as l } from "./index.es54.js";
import { clsx as j } from "./index.es246.js";
import './sections/HomeServices/HomeServices.css';/* empty css */
import { useMemo as v } from "react";
import { l as c } from "./index.es248.js";
import { CardCategory as m } from "./index.es30.js";
import { Col as g } from "./index.es10.js";
import { ArrowLink as T } from "./index.es42.js";
const e = {
LayoutOne: "LayoutOne",
LayoutTwo: "LayoutTwo",
LayoutThree: "LayoutThree",
LayoutFour: "LayoutFour"
}, _ = ({
title: i,
description: h,
goToLabel: p,
href: L,
asLink: y = "a",
items: a,
layout: n = e.LayoutOne,
className: x,
showBlueBackground: d = !1
}) => {
const f = n === e.LayoutOne ? "ui-home-services-layout-one" : n === e.LayoutTwo ? "ui-home-services-layout-two" : n === e.LayoutThree ? "ui-home-services-layout-three" : n === e.LayoutFour ? "ui-home-services-layout-four" : "", t = v(() => {
switch (n) {
case e.LayoutOne:
return a.map((o, s) => {
const u = s !== 0;
return {
...c.omit(o, u ? ["image"] : [])
};
});
case e.LayoutTwo:
return a.map((o) => ({
...c.omit(o, [])
}));
case e.LayoutThree:
return a.map((o, s) => {
const u = s !== 0;
return {
...c.omit(o, u ? ["image"] : [])
};
});
case e.LayoutFour:
return a.map((o, s) => {
const u = s !== 2;
return {
...c.omit(o, u ? ["image"] : [])
};
});
default:
return a;
}
}, [a, n]);
return /* @__PURE__ */ r.jsxs(
l,
{
className: j("base-col ui-home-services-section", x, d ? "blue-background" : ""),
children: [
/* @__PURE__ */ r.jsxs(g, { className: "ui-home-services-section-content", children: [
/* @__PURE__ */ r.jsxs("div", { className: "ui-home-services-section-title", children: [
/* @__PURE__ */ r.jsx(l.Title, { fs: "2", children: i }),
p && L && /* @__PURE__ */ r.jsx(T, { href: L, asLink: y, fs: "7", children: p.toUpperCase() })
] }),
h && /* @__PURE__ */ r.jsx(l.Description, { children: h })
] }),
/* @__PURE__ */ r.jsx(
"ul",
{
role: "list",
"aria-label": `Lista di ${i}`,
className: `list-style-none ${f}`,
children: t == null ? void 0 : t.map((o, s) => /* @__PURE__ */ r.jsx("li", { children: /* @__PURE__ */ r.jsx(
m,
{
title: o == null ? void 0 : o.name,
description: o == null ? void 0 : o.description,
image: o == null ? void 0 : o.image,
href: (o == null ? void 0 : o.link) || (o == null ? void 0 : o.externalLink),
showIcon: o == null ? void 0 : o.externalLink,
asLink: y,
isExternal: o == null ? void 0 : o.externalLink
},
[o._id, s].join("-")
) }, [o._id, s].join("-")))
}
)
]
}
);
};
export {
e as HOME_SERVICES_LAYOUTS,
_ as HomeServices
};
//# sourceMappingURL=index.es139.js.map