import { Thermometer, Droplets, Wind, CloudOff } from "lucide-react"; import type { WeatherData } from "../api"; interface WeatherCardProps { data: WeatherData; accent: "cyan" | "amber"; } const ACCENT = { cyan: { strip: "gold", text: "text-gold", glow: "data-glow-gold", tag: "border-gold/30 text-gold bg-gold/5" }, amber: { strip: "mint", text: "text-mint", glow: "data-glow-mint", tag: "border-mint/30 text-mint bg-mint/5" }, } as const; export default function WeatherCard({ data, accent }: WeatherCardProps) { const a = ACCENT[accent]; if (data.error) { return (

Wetter nicht verfügbar

{data.location || "Unbekannt"}

); } return (
{/* Location tag */}
{data.location}
{/* Temperature hero */}
{Math.round(data.temp)} °

{data.description}

{data.icon}
{/* Stats row */}
} label="Gefühlt" value={`${Math.round(data.feels_like)}°`} /> } label="Feuchte" value={`${data.humidity}%`} /> } label="Wind" value={`${Math.round(data.wind_kmh)}`} unit="km/h" />
); } function StatCell({ icon, label, value, unit }: { icon: React.ReactNode; label: string; value: string; unit?: string; }) { return (
{icon}
{value} {unit && {unit}}
{label}
); }