@anoki/fse-marche-ui
Version:
FSE UI components library
3 lines (2 loc) • 1.56 kB
JavaScript
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./components/ui/CardMapStructure/CardMap.css');const e=require("./index.cjs137.js");;/* empty css */const o=require("react"),i=require("./index.cjs10.js"),R=({id:l,title:u,titleTag:x="h3",href:d,description:m,isExternal:a=!1,asLink:f="a",className:p,address:s,setSelectedCard:j=()=>{}})=>{const h=f,[t,c]=o.useState(!1),r=o.useRef(null);return o.useEffect(()=>{const n=v=>{r.current&&!r.current.contains(v.target)&&c(!1)};return t?document.addEventListener("mousedown",n):document.removeEventListener("mousedown",n),()=>{document.removeEventListener("mousedown",n)}},[t]),e.jsxRuntimeExports.jsxs(i.Col,{as:"div",justifyContent:"center",ref:r,br:"x4",p:"x24",bg:"white",className:`${p} ${t?"ui-is-active":"ui-card-search"} shadow cursor-pointer text-slate-28`,onClick:()=>{c(!0),j(l)},children:[e.jsxRuntimeExports.jsxs(i.Col,{pb:"x24",children:[e.jsxRuntimeExports.jsx(x,{className:"flex-1",children:e.jsxRuntimeExports.jsx(h,{className:"text-decoration-none fs-4 text-primary fw-semibold",href:d,target:a?"_blank":void 0,rel:a?"noreferrer noopener":void 0,children:u})}),e.jsxRuntimeExports.jsx("p",{className:"fs-6 fw-regular",children:m})]}),s&&s.streetName&&e.jsxRuntimeExports.jsxs(i.Col,{as:"footer",gap:"x8",bg:"white",children:[e.jsxRuntimeExports.jsx("h5",{className:"fw-semibold fs-6",children:"Indirizzo"}),e.jsxRuntimeExports.jsx("p",{className:"fw-regular",children:s.plainAddress})]})]})};exports.CardMap=R;
//# sourceMappingURL=index.cjs27.js.map