{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "weather-sm-07",
  "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-07.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  WidgetHeader,\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  const next5Hours =\n    weather?.hourly.time.slice(0, 5).map((time, index) => ({\n      temp: weather.hourly.temperature[index],\n      code: weather.hourly.weatherCode[index],\n    })) || [];\n\n  if (isLoading) {\n    return (\n      <Widget design=\"mumbai\" className=\"gap-6\">\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 design=\"mumbai\" className=\"gap-6\">\n      <WidgetHeader className=\"flex items-center justify-between gap-3\">\n        <div className=\"flex flex-col gap-2\">\n          <Label>{city || \"Unknown\"}</Label>\n          <Label className=\"text-muted-foreground\">\n            Feels Like {weather?.feelsLike}&deg;\n          </Label>\n        </div>\n        <WidgetTitle className=\"text-3xl\">\n          {weather?.temperature}&deg;\n        </WidgetTitle>\n      </WidgetHeader>\n      <WidgetContent className=\"items-start\">\n        <div className=\"flex h-max w-full 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        <div className=\"flex w-full items-center justify-end\">\n          <MoveDownIcon\n            fill=\"currentColor\"\n            className=\"mr-1 size-4\"\n            strokeWidth={4}\n          />\n          <Label>{todayMin}&deg;</Label>\n        </div>\n      </WidgetContent>\n      <WidgetFooter className=\"bg-muted w-full rounded-xl\">\n        <div className=\"flex w-full items-center justify-between gap-1 p-2\">\n          {next5Hours.map((h, i) => (\n            <div key={i} className=\"flex flex-col items-center gap-2\">\n              {getWeatherIcon(h.code, \"size-4\")}\n              <Label className=\"text-xs font-light\">{h.temp}&deg;</Label>\n            </div>\n          ))}\n        </div>\n      </WidgetFooter>\n    </Widget>\n  );\n}\n",
      "type": "registry:component"
    }
  ],
  "meta": {
    "tags": [
      "weather"
    ],
    "size": "sm"
  }
}