Skip to content

armgit / TREK

Public Imported from GitHub
0

The most complete open-source travel planner: real-time collaboration, bookings, budgets, packing lists, journals, offline PWA, SSO and an AI-ready MCP server, with planet-wide place search and routing built in.

625 B
Raw Blame
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;
}