@anoki/fse-ui
Version:
FSE UI components library
84 lines (83 loc) • 2.77 kB
JavaScript
import { j as r } from "./index.es180.js";
import { Section as u } from "./index.es46.js";
import { clsx as f } from "./index.es182.js";
import './sections/HomeServices/HomeServices.css';/* empty css */
import { useMemo as j } from "react";
import { l as t } from "./index.es184.js";
import { CardCategory as v } from "./index.es26.js";
import { Col as w } from "./index.es10.js";
import { ArrowLink as T } from "./index.es35.js";
const s = {
LayoutOne: "LayoutOne",
LayoutTwo: "LayoutTwo",
LayoutThree: "LayoutThree"
}, _ = ({
title: h,
description: i,
goToLabel: p,
href: x,
asLink: L = "a",
items: e,
layout: a = s.LayoutOne,
className: d
}) => {
const y = a === s.LayoutOne ? "ui-home-services-layout-one" : a === s.LayoutTwo ? "ui-home-services-layout-two" : "ui-home-services-layout-three", n = j(() => {
switch (a) {
case s.LayoutOne:
return e.map((o, c) => {
const l = c !== 0;
return {
...t.omit(o, l ? ["image"] : [])
};
});
case s.LayoutTwo:
return e.map((o) => ({
...t.omit(o, [])
}));
case s.LayoutThree:
return e.map((o, c) => {
const l = c !== 0;
return {
...t.omit(o, l ? ["image"] : [])
};
});
default:
return e;
}
}, [e, a]);
return /* @__PURE__ */ r.jsxs(u, { className: f("base-col ui-home-services-section", d), children: [
/* @__PURE__ */ r.jsxs(w, { className: "ui-home-services-section-content", children: [
/* @__PURE__ */ r.jsxs("div", { className: "ui-home-services-section-title", children: [
/* @__PURE__ */ r.jsx(u.Title, { fs: "2", children: h }),
p && x && /* @__PURE__ */ r.jsx(T, { href: x, asLink: L, fs: "7", children: p.toUpperCase() })
] }),
i && /* @__PURE__ */ r.jsx(u.Description, { children: i })
] }),
/* @__PURE__ */ r.jsx(
"ul",
{
role: "list",
"aria-label": `Lista di ${h}`,
className: `list-style-none ${y}`,
children: n == null ? void 0 : n.map((o) => /* @__PURE__ */ r.jsx("li", { children: /* @__PURE__ */ r.jsx(
v,
{
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: L,
isExternal: o == null ? void 0 : o.externalLink
},
o._id
) }, o._id))
}
)
] });
};
export {
s as HOME_SERVICES_LAYOUTS,
_ as HomeServices
};
//# sourceMappingURL=index.es105.js.map