import { toast } from "sonner" import { Loader2 } from "lucide-react" import { useEffect } from "react" import { useWeatherStore } from "../store/weatherStore" import { WeatherCard } from "@/components/WeatherCard" export function meta() { return [ { title: "天气查询页面" }, { name: "description", content: "查询天气信息" } ] } export function Weather() { const { currentWeather, isLoading, error, setError } = useWeatherStore() useEffect(() => { if (error) { toast.error(error) setError("") } }, [ErrorEvent, setError]) return (

天气查询

实时天气

{isLoading && !currentWeather && (

正在加载...

) } {isLoading || currentWeather ? (
) : null}
) }