UNPKG

@anoki/fse-ui

Version:

FSE UI components library

3 lines (2 loc) 2.48 kB
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./sections/HomeServices/HomeServices.css');const s=require("./index.cjs237.js"),h=require("./index.cjs123.js"),E=require("./index.cjs238.js"),u=require("./index.cjs241.js"),g=require("react"),v=require("./index.cjs143.js");;/* empty css */const R=require("./index.cjs25.js"),S=require("./index.cjs36.js"),T=require("./index.cjs61.js"),o={LayoutOne:"LayoutOne",LayoutTwo:"LayoutTwo",LayoutThree:"LayoutThree",LayoutFour:"LayoutFour"},q=({title:i,description:p,goToLabel:x,href:l,asLink:d="a",items:n,layout:a=o.LayoutOne,className:L,showBlueBackground:y=!1})=>{const j=a===o.LayoutOne?"ui-home-services-layout-one":a===o.LayoutTwo?"ui-home-services-layout-two":a===o.LayoutThree?"ui-home-services-layout-three":a===o.LayoutFour?"ui-home-services-layout-four":"",c=g.useMemo(()=>{switch(a){case o.LayoutOne:return n.map((e,r)=>{const t=r!==0;return{...u.lodashExports.omit(e,t?["image"]:[])}});case o.LayoutTwo:return n.map(e=>({...u.lodashExports.omit(e,[])}));case o.LayoutThree:return n.map((e,r)=>{const t=r!==0;return{...u.lodashExports.omit(e,t?["image"]:[])}});case o.LayoutFour:return n.map((e,r)=>{const t=r!==2;return{...u.lodashExports.omit(e,t?["image"]:[])}});default:return n}},[n,a]);return s.jsxRuntimeExports.jsxs(h.Section,{className:E.clsx("base-col ui-home-services-section",L,y?"blue-background":""),children:[s.jsxRuntimeExports.jsx(T.Col,{className:"ui-home-services-section-content",children:s.jsxRuntimeExports.jsx(h.SectionHeading,{title:i,description:s.jsxRuntimeExports.jsx(v.RichText,{description:p}),className:"ui-home-services-section-title",color:"slate-20",mdFs:"1",titleMarginBottom:"mb-x0",descriptionMarginBottom:"mb-x0",children:x&&l&&s.jsxRuntimeExports.jsx(R.ArrowLink,{href:l,asLink:d,fs:"7",children:x.toUpperCase()})})}),s.jsxRuntimeExports.jsx("ul",{role:"list","aria-label":`Lista di ${i}`,className:`list-style-none ${j}`,children:c==null?void 0:c.map((e,r)=>s.jsxRuntimeExports.jsx("li",{children:s.jsxRuntimeExports.jsx(S.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:d,isExternal:e==null?void 0:e.externalLink},[e._id,r].join("-"))},[e._id,r].join("-")))})]})};exports.HOME_SERVICES_LAYOUTS=o;exports.HomeServices=q; //# sourceMappingURL=index.cjs141.js.map