"use client"
import{useEffect as u,useState as n}from"react";function o(){return typeof window>"u"?null:window.matchMedia("(min-width: 1024px)").matches?"desktop":window.matchMedia("(min-width: 640px)").matches?"tablet":"mobile"}function d(){return typeof window>"u"?null:{width:window.innerWidth,height:window.innerHeight}}function h(){let[e,s]=n(o()),[t,r]=n(d());return u(()=>{let i=()=>{s(o()),r(d())};return i(),window.addEventListener("resize",i),()=>{window.removeEventListener("resize",i)}},[]),{device:e,width:t?.width,height:t?.height,isMobile:e==="mobile",isTablet:e==="tablet",isDesktop:e==="desktop"}}export{h as a};
