import { useWeatherStore } from "@/store/weatherStore"; import { Cloud, CloudDrizzle, CloudFog, CloudLightning, CloudMoon, CloudRain, CloudSnow, CloudSun, MapPin, Moon, Sun, ThermometerSun } from "lucide-react"; import { formatTemperature } from "../lib/utils"; interface WeatherIconProps { description: string; isDay: string; className?: string; } function WeatherIcon({ description, isDay, className='w-16 h-16 md:w-20 md:h-20' }: WeatherIconProps) { const desc = description.toLowerCase(); const isDaytime = isDay === 'yes'; if(desc.includes('雨') || desc.includes('rain')) return if(desc.includes('雪') || desc.includes('snow')) return if(desc.includes('雷') || desc.includes('thunderstorm')) return if(desc.includes('fog') || desc.includes('雾')) return if(desc.includes('cloudy') || desc.includes('阴') || desc.includes('overcast')) return if(desc.includes('heavy') || desc.includes('暴')) return if(desc.includes('晴') || desc.includes('clear') || desc.includes('sunny')) return ( isDaytime ? : ) if(desc.includes('scattered') || desc.includes('多云') || desc.includes('partial')) return ( isDaytime ? : ) return isDaytime ? : } export function WeatherDisplay(){ const {currentWeather} = useWeatherStore(); if (!currentWeather) return null; return (

{currentWeather.location.name}

{currentWeather.location.country}
{formatTemperature(currentWeather.current.temperature)} °C

{currentWeather.current.weather_descriptions[0]}

体感 {formatTemperature(currentWeather.current.feelslike)}°C
) }