@anoki/fse-ui
Version:
FSE UI components library
110 lines (109 loc) • 3.49 kB
JavaScript
import { j as s } from "./index.es237.js";
import { Section as m, SectionHeading as f } from "./index.es123.js";
import { clsx as g } from "./index.es238.js";
import { l as t } from "./index.es241.js";
import { useMemo as j } from "react";
import { RichText as v } from "./index.es143.js";
import './sections/HomeServices/HomeServices.css';/* empty css */
import { ArrowLink as T } from "./index.es25.js";
import { CardCategory as w } from "./index.es36.js";
import { Col as O } from "./index.es61.js";
const r = {
LayoutOne: "LayoutOne",
LayoutTwo: "LayoutTwo",
LayoutThree: "LayoutThree",
LayoutFour: "LayoutFour"
}, H = ({
title: l,
description: L,
goToLabel: i,
href: p,
asLink: h = "a",
items: a,
layout: n = r.LayoutOne,
className: x,
showBlueBackground: y = !1
}) => {
const d = n === r.LayoutOne ? "ui-home-services-layout-one" : n === r.LayoutTwo ? "ui-home-services-layout-two" : n === r.LayoutThree ? "ui-home-services-layout-three" : n === r.LayoutFour ? "ui-home-services-layout-four" : "", u = j(() => {
switch (n) {
case r.LayoutOne:
return a.map((o, e) => {
const c = e !== 0;
return {
...t.omit(o, c ? ["image"] : [])
};
});
case r.LayoutTwo:
return a.map((o) => ({
...t.omit(o, [])
}));
case r.LayoutThree:
return a.map((o, e) => {
const c = e !== 0;
return {
...t.omit(o, c ? ["image"] : [])
};
});
case r.LayoutFour:
return a.map((o, e) => {
const c = e !== 2;
return {
...t.omit(o, c ? ["image"] : [])
};
});
default:
return a;
}
}, [a, n]);
return /* @__PURE__ */ s.jsxs(
m,
{
className: g(
"base-col ui-home-services-section",
x,
y ? "blue-background" : ""
),
children: [
/* @__PURE__ */ s.jsx(O, { className: "ui-home-services-section-content", children: /* @__PURE__ */ s.jsx(
f,
{
title: l,
description: /* @__PURE__ */ s.jsx(v, { description: L }),
className: "ui-home-services-section-title",
color: "slate-20",
mdFs: "1",
titleMarginBottom: "mb-x0",
descriptionMarginBottom: "mb-x0",
children: i && p && /* @__PURE__ */ s.jsx(T, { href: p, asLink: h, fs: "7", children: i.toUpperCase() })
}
) }),
/* @__PURE__ */ s.jsx(
"ul",
{
role: "list",
"aria-label": `Lista di ${l}`,
className: `list-style-none ${d}`,
children: u == null ? void 0 : u.map((o, e) => /* @__PURE__ */ s.jsx("li", { children: /* @__PURE__ */ s.jsx(
w,
{
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: h,
isExternal: o == null ? void 0 : o.externalLink
},
[o._id, e].join("-")
) }, [o._id, e].join("-")))
}
)
]
}
);
};
export {
r as HOME_SERVICES_LAYOUTS,
H as HomeServices
};
//# sourceMappingURL=index.es141.js.map