@devgateway/dvz-ui-react
Version:
A modular, embeddable React component library for data visualization and UI, built with TypeScript. Provides reusable components for charts, maps, dashboards, and more, with built-in support for internationalization and Redux integration.
2 lines (1 loc) • 699 B
JavaScript
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("../../utils/deviceType.js"),t=require("react"),u=o=>{const{getDeviceType:e,getHeight:i}=o||{},[w,s]=t.useState(()=>({width:typeof window<"u"?window.innerWidth:0,...i&&{height:typeof window<"u"?window.innerHeight:0},...e&&{deviceType:typeof window<"u"?d.default():"desktop"}}));return t.useEffect(()=>{const n=()=>{s(r=>({...r,width:window.innerWidth,...i&&{height:window.innerHeight},...e&&{deviceType:d.default()}}))};return typeof window<"u"&&(window.addEventListener("resize",n),n()),()=>{typeof window<"u"&&window.removeEventListener("resize",n)}},[i,e]),w};exports.useWindowDimensionsAndDevice=u;
;