mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-22 13:10:29 +00:00
9f3e1f8c83
The day plan, the day panel, the phone timeline and the phone day sheet read the day local weather anchor from dayWeatherAnchor, and every weather icon comes from one map in weatherIcons.
20 lines
625 B
TypeScript
20 lines
625 B
TypeScript
import { Cloud, CloudDrizzle, CloudLightning, CloudRain, CloudSnow, Sun, Wind, type LucideIcon } from 'lucide-react';
|
|
|
|
/** The icon for each weather condition the forecast names. */
|
|
export const WEATHER_ICON_MAP: Record<string, LucideIcon> = {
|
|
Clear: Sun,
|
|
Clouds: Cloud,
|
|
Rain: CloudRain,
|
|
Drizzle: CloudDrizzle,
|
|
Thunderstorm: CloudLightning,
|
|
Snow: CloudSnow,
|
|
Mist: Wind,
|
|
Fog: Wind,
|
|
Haze: Wind,
|
|
};
|
|
|
|
/** The icon for a forecast's condition; an unknown or missing one shows a cloud. */
|
|
export function weatherIconFor(main: string | undefined): LucideIcon {
|
|
return (main && WEATHER_ICON_MAP[main]) || Cloud;
|
|
}
|