diff --git a/app/components/WeatherDetailsGird.tsx b/app/components/WeatherDetailsGird.tsx index 2287c34..6765d7e 100644 --- a/app/components/WeatherDetailsGird.tsx +++ b/app/components/WeatherDetailsGird.tsx @@ -1,3 +1,5 @@ +import { Cloud, Droplets, Gauge, ThermometerSun, Wind } from "lucide-react"; + interface WeatherDetailsGridProps { icon: React.ReactNode; label: string; @@ -5,3 +7,53 @@ interface WeatherDetailsGridProps { subtitle?: string; } +function WeatherInfoItem({ icon, label, value, subtitle }: WeatherDetailsGridProps) { + return( +
+
+
+ {icon} +
+
+

{label}

+

{value}

+ {subtitle &&

{subtitle}

} +
+
+
+ ) +} + +export function WeatherDetailsGrid(){ + const currentWeather = useWeatherState(); + if(!currentWeather) return null; + return( +
+
+ } label="湿度" value={`${currentWeather.current.humidity}%`} /> + } label="风速" value={`${currentWeather.current.wind_speed} m/s`} /> + } label="气压" value={`${currentWeather.current.pressure} hPa`} /> + } label="云量" value={`${currentWeather.current.cloudcover}%`} /> + } label="紫外线" value={`${currentWeather.current.uv_index} UV`} /> +
+
+
+
+ + 降水量:\ + + {currentWeather.current.precipitation} mm + + +
+ + {currentWeather.current.is_day === "yes" ? "白天" : "夜晚"} + +
+

+ 观测时间: {currentWeather.current.observation_time} +

+
+
+ ) +} \ No newline at end of file diff --git a/package.json b/package.json index 653642a..c7da746 100644 --- a/package.json +++ b/package.json @@ -43,4 +43,12 @@ "vite": "^7.1.7", "vite-tsconfig-paths": "^5.1.4" } +<<<<<<< HEAD +<<<<<<< HEAD } +======= +} +>>>>>>> 34ee14ecd423bb649a4c45f54ab6e3f37ad0f35f +======= +} +>>>>>>> 12e66397d84bd55cde0c1b209d3e943e5e20bcb9