feat: add Polish and English language switcher
This commit is contained in:
@@ -8,12 +8,14 @@ import { FavoritesSection } from "@/components/weather/favorites-section";
|
||||
import { StationsExplorer } from "@/components/weather/stations-explorer";
|
||||
import { PageLoadingSkeleton } from "@/components/states/loading-skeleton";
|
||||
import { ErrorState } from "@/components/states/error-state";
|
||||
import { useI18n } from "@/lib/i18n";
|
||||
|
||||
export function DashboardPage() {
|
||||
const { t } = useI18n();
|
||||
const { data: stations, isPending, isError, refetch } = useWeatherStations();
|
||||
const selectedStationId = useWeatherStore((state) => state.selectedStationId);
|
||||
if (isPending) return <PageLoadingSkeleton />;
|
||||
if (isError || !stations?.length) return <ErrorState onRetry={() => refetch()} description="Nie udało się pobrać listy stacji synoptycznych IMGW." />;
|
||||
if (isError || !stations?.length) return <ErrorState onRetry={() => refetch()} description={t("dashboard.error")} />;
|
||||
const selectedStation = stations.find((station) => station.id === selectedStationId)
|
||||
?? stations.find((station) => station.name === DEFAULT_STATION_NAME)
|
||||
?? stations[0];
|
||||
|
||||
Reference in New Issue
Block a user