{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "weather-sm-04",
  "type": "registry:component",
  "registryDependencies": [
    "https://wigggle-ui.vercel.app/r/widget.json",
    "https://wigggle-ui.vercel.app/r/label.json",
    "https://wigggle-ui.vercel.app/r/use-location.json",
    "https://wigggle-ui.vercel.app/r/use-weather.json",
    "https://wigggle-ui.vercel.app/r/weather-utils.json"
  ],
  "files": [
    {
      "path": "registry/default/widgets/weather/sm/weather-04.tsx",
      "content": "import {\n  DEFAULT_LOCATION,\n  useLocation,\n} from \"@/registry/default/hooks/use-location\";\nimport { useWeather } from \"@/registry/default/hooks/use-weather\";\nimport { getWeatherDescription } from \"@/registry/default/lib/weather-utils\";\nimport { Label } from \"@/registry/default/ui/label\";\nimport { Widget, WidgetContent } from \"@/registry/default/ui/widget\";\n\nexport default function WidgetDemo() {\n  const { coordinates, isLoading: isLoadingLocation } = useLocation();\n  const { data: weather, isLoading: isLoadingWeather } = useWeather(\n    coordinates?.lat ?? DEFAULT_LOCATION.lat,\n    coordinates?.lon ?? DEFAULT_LOCATION.lon,\n  );\n\n  const isLoading = isLoadingLocation || isLoadingWeather;\n\n  const currentDate = new Date().toLocaleDateString(\"en-US\", {\n    weekday: \"short\",\n    month: \"short\",\n    day: \"numeric\",\n  });\n\n  if (isLoading) {\n    return (\n      <Widget>\n        <WidgetContent className=\"mx-auto flex-col items-center justify-center\">\n          <Label className=\"animate-pulse\">Loading...</Label>\n        </WidgetContent>\n      </Widget>\n    );\n  }\n\n  return (\n    <Widget>\n      <WidgetContent className=\"mx-auto flex-col items-start\">\n        <Label className=\"text-6xl\">{weather?.temperature}&deg;</Label>\n        <Label className=\"text-2xl\">\n          {weather ? getWeatherDescription(weather.weatherCode) : \"Sunny\"}\n        </Label>\n        <Label>{currentDate}</Label>\n      </WidgetContent>\n    </Widget>\n  );\n}\n",
      "type": "registry:component"
    }
  ],
  "meta": {
    "tags": [
      "weather"
    ],
    "size": "sm"
  }
}