@anoki/fse-ui
Version:
FSE UI components library
3 lines (2 loc) • 2.13 kB
JavaScript
;Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./sections/HomeServices/HomeServices.css');const s=require("./index.cjs180.js"),u=require("./index.cjs46.js"),y=require("./index.cjs182.js");;/* empty css */const L=require("react"),x=require("./index.cjs184.js"),R=require("./index.cjs26.js"),S=require("./index.cjs10.js"),v=require("./index.cjs35.js"),r={LayoutOne:"LayoutOne",LayoutTwo:"LayoutTwo",LayoutThree:"LayoutThree"},O=({title:i,description:l,goToLabel:d,href:h,asLink:p="a",items:o,layout:n=r.LayoutOne,className:j})=>{const E=n===r.LayoutOne?"ui-home-services-layout-one":n===r.LayoutTwo?"ui-home-services-layout-two":"ui-home-services-layout-three",a=L.useMemo(()=>{switch(n){case r.LayoutOne:return o.map((e,c)=>{const t=c!==0;return{...x.lodashExports.omit(e,t?["image"]:[])}});case r.LayoutTwo:return o.map(e=>({...x.lodashExports.omit(e,[])}));case r.LayoutThree:return o.map((e,c)=>{const t=c!==0;return{...x.lodashExports.omit(e,t?["image"]:[])}});default:return o}},[o,n]);return s.jsxRuntimeExports.jsxs(u.Section,{className:y.clsx("base-col ui-home-services-section",j),children:[s.jsxRuntimeExports.jsxs(S.Col,{className:"ui-home-services-section-content",children:[s.jsxRuntimeExports.jsxs("div",{className:"ui-home-services-section-title",children:[s.jsxRuntimeExports.jsx(u.Section.Title,{fs:"2",children:i}),d&&h&&s.jsxRuntimeExports.jsx(v.ArrowLink,{href:h,asLink:p,fs:"7",children:d.toUpperCase()})]}),l&&s.jsxRuntimeExports.jsx(u.Section.Description,{children:l})]}),s.jsxRuntimeExports.jsx("ul",{role:"list","aria-label":`Lista di ${i}`,className:`list-style-none ${E}`,children:a==null?void 0:a.map(e=>s.jsxRuntimeExports.jsx("li",{children:s.jsxRuntimeExports.jsx(R.CardCategory,{title:e==null?void 0:e.name,description:e==null?void 0:e.description,image:e==null?void 0:e.image,href:(e==null?void 0:e.link)||(e==null?void 0:e.externalLink),showIcon:e==null?void 0:e.externalLink,asLink:p,isExternal:e==null?void 0:e.externalLink},e._id)},e._id))})]})};exports.HOME_SERVICES_LAYOUTS=r;exports.HomeServices=O;
//# sourceMappingURL=index.cjs105.js.map