{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "use-mobile",
  "title": "Use Mobile",
  "description": "A media query hook for mobile responsive UI.",
  "registryDependencies": [
    "@retab/use-mount-effect"
  ],
  "files": [
    {
      "path": "registry/new-york-v4/hooks/use-mobile.ts",
      "content": "import * as React from \"react\";\nimport { useMountEffect } from \"@/hooks/use-mount-effect\";\n\nconst MOBILE_BREAKPOINT = 768;\n\nexport function useIsMobile() {\n  const [isMobile, setIsMobile] = React.useState<boolean | undefined>(\n    undefined,\n  );\n\n  useMountEffect(() => {\n    const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);\n    const onChange = () => {\n      setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);\n    };\n    mql.addEventListener(\"change\", onChange);\n    setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);\n    return () => mql.removeEventListener(\"change\", onChange);\n  });\n\n  return !!isMobile;\n}\n",
      "type": "registry:hook",
      "target": "@hooks/use-mobile.ts"
    }
  ],
  "type": "registry:hook"
}