@anoki/fse-ui
Version:
FSE UI components library
121 lines (120 loc) • 3.74 kB
JavaScript
import { j as o } from "./index.es244.js";
import { Section as i } from "./index.es54.js";
import { clsx as d } from "./index.es246.js";
import './sections/Services/Services.css';/* empty css */
import { useMemo as f } from "react";
import { l as t } from "./index.es248.js";
import { Col as m } from "./index.es10.js";
import { ArrowLink as j } from "./index.es42.js";
import { CardCategory as g } from "./index.es30.js";
const e = {
LayoutOne: "LayoutOne",
LayoutTwo: "LayoutTwo",
LayoutThree: "LayoutThree",
LayoutFour: "LayoutFour",
LayoutFive: "LayoutFive"
}, _ = ({
title: l,
description: y,
goToLabel: L,
href: p,
asLink: h = "a",
items: a,
layout: u = e.LayoutOne,
className: v
}) => {
const x = ((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";
case e.LayoutFive:
return "ui-service-items-layout-five";
default:
return "";
}
})(u), n = f(() => {
switch (u) {
/**
* In this layout, we remove the image from all items.
*/
case e.LayoutOne:
return a.map((r) => ({
...t.omit(r, ["image"])
}));
/**
* In this layout, we remove the image from all items except the second one.
*/
case e.LayoutTwo:
return a.map((r, s) => {
const c = s !== 1;
return {
...t.omit(r, c ? ["image"] : [])
};
});
/**
* In this layout, we remove the image from all items.
*/
case e.LayoutThree:
return a.map((r) => ({
...t.omit(r, ["image"])
}));
/**
* In this layout, we remove the image from all items.
*/
case e.LayoutFour:
return a.map((r, s) => {
const c = s !== 0;
return {
...t.omit(r, c ? ["image"] : [])
};
});
case e.LayoutFive:
return a.map((r) => ({
...t.omit(r, ["image"])
}));
default:
return a;
}
}, [a, u]);
return /* @__PURE__ */ o.jsxs(i, { className: d("base-col ui-service-items-section", v), 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(i.Title, { fs: "2", mdFs: "2", as: "h1", color: "slate-20", children: l }),
L && p && /* @__PURE__ */ o.jsx(j, { href: p, asLink: h, fs: "7", children: L.toUpperCase() })
] }),
y && /* @__PURE__ */ o.jsx(i.Description, { children: y })
] }),
/* @__PURE__ */ o.jsx(
"ul",
{
role: "list",
"aria-label": `Lista di ${l}`,
className: `list-style-none ${x}`,
children: n == null ? void 0 : n.map((r, s) => /* @__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, s].join("-")
) }, [r._id, s].join("-")))
}
)
] });
};
export {
e as SERVICES_LAYOUTS,
_ as Services
};
//# sourceMappingURL=index.es142.js.map