test/1114/app/components/weather/WeatherCard.tsx

34 lines
1.2 KiB
TypeScript
Raw Normal View History

2025-11-14 18:49:33 +08:00
import { WeathersearchForm } from "@/components/weather/WeatherSearchForm";
import { WeatherDisplay } from "@/components/weather/WeatherDisplay";
import { WeatherDetailsGrid } from "@/components/weather/WeatherDetailsCrid";
import { useWeatherStore } from "@/store/weatherStore";
2025-11-14 18:38:11 +08:00
import Cloud from "../../../assets/cloud.svg";
export function WeatherCard() {
const { currentWeather } = useWeatherStore();
return (
<div>
<WeathersearchForm />
{currentWeather ? (
<div className="P-4">
<WeatherDisplay />
<WeatherDetailsGrid />
</div>
) : (
<div className="flex flex-col items-center justify-center h-full">
<div className="animate-spin">
<div className="h-10 w-10 border-t-2 border-b-2 border-gray-900 rounded-full"></div>
<div className="h-10 w-10">
<Cloud/>
</div>
</div>
<h3 className="text-2xl font-bold text-slate-700 dark:text-slate-200 mb-2"></h3>
<p className="text-sm text-slate-500 dark:text-slate-400"></p>
</div>
)}
</div>
);
}