{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "weather-sm-08",
  "type": "registry:component",
  "dependencies": [
    "lucide-react"
  ],
  "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-08.tsx",
      "content": "import { MoveDownIcon, MoveUpIcon } from \"lucide-react\";\n\nimport {\n  DEFAULT_LOCATION,\n  useLocation,\n} from \"@/registry/default/hooks/use-location\";\nimport { useWeather } from \"@/registry/default/hooks/use-weather\";\nimport { getWeatherIcon } from \"@/registry/default/lib/weather-utils\";\nimport { Label } from \"@/registry/default/ui/label\";\nimport {\n  Widget,\n  WidgetContent,\n  WidgetFooter,\n  WidgetTitle,\n} from \"@/registry/default/ui/widget\";\n\nexport default function WidgetDemo() {\n  const { coordinates, city, 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 todayMax = weather?.daily?.temperatureMax[0];\n  const todayMin = weather?.daily?.temperatureMin[0];\n\n  if (isLoading) {\n    return (\n      <Widget>\n        <WidgetContent className=\"flex items-center justify-center\">\n          <Label className=\"animate-pulse\">Loading...</Label>\n        </WidgetContent>\n      </Widget>\n    );\n  }\n\n  return (\n    <Widget>\n      <WidgetTitle>{city || \"Unknown\"}</WidgetTitle>\n      <WidgetContent className=\"flex items-center justify-center gap-2\">\n        {weather &&\n          getWeatherIcon(weather.weatherCode, \"size-10\", { strokeWidth: 2 })}\n        <Label className=\"text-5xl\">{weather?.temperature}&deg;</Label>\n      </WidgetContent>\n      <WidgetFooter className=\"justify-between gap-3\">\n        <div className=\"flex items-center justify-start\">\n          <MoveDownIcon\n            fill=\"currentColor\"\n            className=\"mr-1 size-4\"\n            strokeWidth={4}\n          />\n          <Label>{todayMin}&deg;</Label>\n        </div>\n        <div className=\"flex h-max items-center justify-start\">\n          <MoveUpIcon\n            fill=\"currentColor\"\n            className=\"mr-1 size-4\"\n            strokeWidth={4}\n          />\n          <Label>{todayMax}&deg;</Label>\n        </div>\n      </WidgetFooter>\n    </Widget>\n  );\n}\n",
      "type": "registry:component"
    }
  ],
  "meta": {
    "tags": [
      "weather"
    ],
    "size": "sm"
  }
}