"use client"; import Link from "next/link"; import { motion } from "framer-motion"; import { Droplets, Gauge, Heart, Wind } from "lucide-react"; import { useWeatherStore } from "@/lib/store"; import { formatHumidity, formatPressure, formatTemperature, getWeatherMoodFromData } from "@/lib/weather-utils"; import type { SynopStation } from "@/types/imgw"; import { Card } from "@/components/ui/card"; import { Button } from "@/components/ui/button"; import { WeatherIcon } from "@/components/weather/weather-icon"; import { cn } from "@/lib/utils"; export function StationCard({ station, index = 0 }: { station: SynopStation; index?: number }) { const favorites = useWeatherStore((state) => state.favorites); const toggleFavorite = useWeatherStore((state) => state.toggleFavorite); const selectStation = useWeatherStore((state) => state.selectStation); const favorite = favorites.includes(station.id); const mood = getWeatherMoodFromData(station); const compactWind = station.windSpeed === null ? "—" : `${station.windSpeed.toFixed(1)} m/s`; return (
selectStation(station.id)} className="min-w-0 flex-1 rounded-lg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sky-500">

{station.name}

{formatTemperature(station.temperature)}

selectStation(station.id)} className="mt-4 grid grid-cols-3 gap-2 rounded-lg text-[0.68rem] text-slate-500 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sky-500 dark:text-slate-400"> {formatHumidity(station.humidity)} {compactWind} {station.pressure === null ? "—" : formatPressure(station.pressure).split(" ")[0]}
); }