{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "online-status-demo", "registryDependencies": [ "https://reusables.vercel.app/r/submit-button" ], "files": [ { "path": "registry/example/online-status-demo.tsx", "content": "\"use client\"\n\nimport { RefreshCcw, Signal, WifiIcon } from \"lucide-react\"\n\nimport { Button } from \"@/components/ui/button\"\n\nimport useOnlineStatus from \"@/hooks/use-online-status\"\n\nexport default function NetworkStatusMonitor() {\n const {\n isOnline,\n lastChanged,\n connectionQuality,\n latency,\n checkConnectionNow,\n retryConnection,\n isRetrying,\n } = useOnlineStatus()\n\n return (\n
\n
\n
\n

Network Status

\n \n \n {isOnline ? \"Online\" : \"Offline\"}\n \n
\n\n
\n
\n Quality\n
\n \n {connectionQuality}\n {latency > 0 && (\n {latency.toFixed(0)}ms\n )}\n
\n
\n\n
\n Last Updated\n \n {new Date(lastChanged).toLocaleTimeString()}\n \n
\n
\n\n
\n {isOnline ?\n \n \n Check Now\n \n : \n }\n
\n
\n
\n )\n}\n", "type": "registry:example", "target": "components/online-status-demo.tsx" } ], "type": "registry:example" }