import { Cloud, Droplets, Gauge, ThermometerSun, Wind } from "lucide-react";
import { useWeatherStore } from "@/store/weatherStore";
import { MapPin, Thermometer } from "lucide-react";
interface WeatherDetailsGridProps {
icon: React.ReactNode;
label: string;
value: string;
subtitle?: string;
}
function WeatherInfoItem({ icon, label, value, subtitle }: WeatherDetailsGridProps) {
return(
{icon}
{label}
{value}
{subtitle &&
{subtitle}
}
)
}
export function WeatherDetailsGrid(){
const {currentWeather} = useWeatherStore();
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.precip} mm
{currentWeather.current.is_day === "yes" ? "白天" : "夜晚"}
观测时间: {currentWeather.current.observation_time}
)
}