import { Cloud, CloudDrizzle, CloudFog, CloudLightning, CloudRain, CloudSnow, CloudSun, Sun } from "lucide-react";

export function ForecastIcon({ code, className = "" }: { code: number | null; className?: string }) {
  const Icon = code === 0 ? Sun
    : code === 1 || code === 2 ? CloudSun
      : code === 45 || code === 48 ? CloudFog
        : code !== null && code >= 51 && code <= 57 ? CloudDrizzle
          : code !== null && ((code >= 61 && code <= 67) || (code >= 80 && code <= 82)) ? CloudRain
            : code !== null && ((code >= 71 && code <= 77) || code === 85 || code === 86) ? CloudSnow
              : code !== null && code >= 95 ? CloudLightning
                : Cloud;
  return <Icon className={className} strokeWidth={1.45} />;
}
