"use client"; import Link from "next/link"; import { ArrowLeft, Heart, ShieldCheck } from "lucide-react"; import { useWeatherStation } from "@/hooks/use-weather-stations"; import { useWeatherStore } from "@/lib/store"; import { formatDateTime } from "@/lib/weather-utils"; import { cn } from "@/lib/utils"; import { Button } from "@/components/ui/button"; import { Card } from "@/components/ui/card"; import { WeatherHero } from "@/components/weather/weather-hero"; import { WeatherDetailsGrid } from "@/components/weather/current-conditions-card"; import { SnapshotChart } from "@/components/charts/snapshot-chart"; import { PageLoadingSkeleton } from "@/components/states/loading-skeleton"; import { ErrorState } from "@/components/states/error-state"; import { useI18n } from "@/lib/i18n"; export function StationDetailPage({ id }: { id: string }) { const { language, t } = useI18n(); const { data: station, isPending, isError, refetch } = useWeatherStation(id); const favoriteIds = useWeatherStore((state) => state.favorites); const toggleFavorite = useWeatherStore((state) => state.toggleFavorite); if (isPending) return ; if (isError || !station) return refetch()} description={t("station.error")} />; const favorite = favoriteIds.includes(station.id); return (
{t("station.all")}

{t("station.label", { name: station.name })}

{t("station.parameters")}

{t("station.parametersDescription")}

{t("station.quality")}

{t("station.lastMeasurementImgw")}

{t("station.qualityDescription")}

{t("station.lastMeasurement")}
{formatDateTime(station.measuredAt, language)}
{t("station.source")}
{t("station.publicApi")}
); }