import { comfortHearts, formatClock, formatCoords, formatTemp, placeLabel, precipOutlook, type Units } from "@/lib/display"; import { pixelLabel } from "@/lib/styles"; import type { Place, WeatherReport } from "@/lib/weather/types"; import { AlertsBanner } from "./AlertsBanner"; import { ConditionsGrid } from "./ConditionsGrid"; import { ForecastPanel, type ForecastView } from "./forecast/ForecastPanel"; import { HeartMeter, SkyIcon } from "./PixelArt"; import { Slot } from "./Slot"; /** Everything shown once a report has loaded: alerts, hero, conditions, forecast. */ export function WeatherView({ report, place, units, forecastView, onForecastViewChange, providerLabel, maxDaysOnPlan }: { report: WeatherReport; place: Place; units: Units; forecastView: ForecastView; onForecastViewChange: (view: ForecastView) => void; providerLabel: string; maxDaysOnPlan: number; }) { const { current, daily } = report; const today = daily[0]; const outlook = precipOutlook(report.hourly, report.timeZone); return (
Local {formatClock(report.fetchedAt, report.timeZone)} · {formatCoords(place.lat, place.lon)}
{formatTemp(current.tempC, units)}
{current.description} {today && ( {" "}· High {formatTemp(today.highC, units)}, low {formatTemp(today.lowC, units)} )}
{outlook &&{outlook}
}