UNPKG

@lanaco/lnc-react-ui

Version:

React component library

38 lines (33 loc) 1.28 kB
"use strict";const t=require("react/jsx-runtime"),n=require("react"),c=require("./useDetectMobile-DYV6V1yw.cjs"),o=require("./emotion-styled.browser.esm-DwHBgTPn.cjs"),m=require("./breakpoints-CcVm-gVm.cjs"),d=o.styled.div` width: 100%; height: 100%; max-width: 60.625rem; max-height: 5.625rem; & .wrapper__image { width: 100%; height: 100%; max-width: 60.625rem; max-height: 5.625rem; } &:hover { cursor: pointer; } @media ${m.down("S")} { width: 100%; height: 100%; max-width: 100%; max-height: 100%; aspect-ratio: 1 / 1; & .wrapper__image { width: 100%; height: 100%; max-width: 100%; max-height: 100%; aspect-ratio: 1 / 1; } } `,p=n.forwardRef(({image:i,imageForMobile:r,isMobile:s,onSelectCard:e},a)=>t.jsx(d,{ref:a,children:t.jsx("img",{src:s?r:i,className:"wrapper__image",onClick:e})})),w=o.styled.div` display: flex; justify-content: center; width: 100%; `,x=n.forwardRef(({image:i,imageForMobile:r,link:s,onSelectCard:e=()=>{}},a)=>{const h=c.useDetectMobile();return t.jsx(w,{ref:a,className:"lp-section lp-general-section lp-ad-banner-section",children:t.jsx(p,{image:i,imageForMobile:r,isMobile:h,onSelectCard:()=>e==null?void 0:e(s)})})});module.exports=x;