{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "use-mobile",
  "title": "Mobile breakpoint",
  "description": "An SSR-safe external media-query subscription shared by Sidebar.",
  "files": [
    {
      "path": "registry/familis/ui/hooks/use-mobile.ts",
      "content": "\"use client\"\n\nimport { useSyncExternalStore } from \"react\"\n\nconst MOBILE_BREAKPOINT = 768\n\nfunction subscribe(onChange: () => void) {\n  const query = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`)\n  query.addEventListener(\"change\", onChange)\n  return () => query.removeEventListener(\"change\", onChange)\n}\n\nconst getSnapshot = () => window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`).matches\nconst getServerSnapshot = () => false\n\nexport function useIsMobile() {\n  return useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot)\n}\n",
      "type": "registry:hook"
    }
  ],
  "meta": {
    "storybookId": "ui-hooks-mobile-breakpoint--default"
  },
  "type": "registry:hook"
}