import {
  faBinoculars,
  faBolt,
  faBuilding,
  faCamera,
  faCameraRetro,
  faCampground,
  faCar,
  faCity,
  faCloud,
  faCloudMoon,
  faCompass,
  faCouch,
  faEye,
  faFire,
  faFireAlt,
  faGem,
  faGlobe,
  faHandSparkles,
  faHeart,
  faHome,
  faLeaf,
  faLightbulb,
  faMapMarkerAlt,
  faMoon,
  faMountain,
  faPalette,
  faRoad,
  faSeedling,
  faSmile,
  faSnowflake,
  faSolarPanel,
  faSpa,
  faStar,
  faStreetView,
  faSun,
  faTools,
  faTree,
  faTruck,
  faUmbrellaBeach,
  faWater,
  faWind,
  type IconDefinition,
} from "@fortawesome/free-solid-svg-icons";

/**
 * Shared icon map for consistent icon usage across the application.
 * Maps icon names (strings) to FontAwesome icon definitions.
 */
export const ICON_MAP: Record<string, IconDefinition> = {
  Moon: faMoon,
  Tree: faTree,
  Leaf: faLeaf,
  Lightbulb: faLightbulb,
  Star: faStar,
  CloudMoon: faCloudMoon,
  Cloud: faCloud,
  Water: faWater,
  Mountain: faMountain,
  Campground: faCampground,
  UmbrellaBeach: faUmbrellaBeach,
  Fire: faFire,
  Bolt: faBolt,
  Sun: faSun,
  Seedling: faSeedling,
  Globe: faGlobe,
  Home: faHome,
  Road: faRoad,
  MapMarkerAlt: faMapMarkerAlt,
  Eye: faEye,
  Heart: faHeart,
  Spa: faSpa,
  Snowflake: faSnowflake,
  Wind: faWind,
  Couch: faCouch,
  Tools: faTools,
  Palette: faPalette,
  Gem: faGem,
  Smile: faSmile,
  HandSparkles: faHandSparkles,
  SolarPanel: faSolarPanel,
  Car: faCar,
  Truck: faTruck,
  Building: faBuilding,
  City: faCity,
  Compass: faCompass,
  Binoculars: faBinoculars,
  CameraRetro: faCameraRetro,
  Camera: faCamera,
  FireAlt: faFireAlt,
  StreetView: faStreetView,
};

/**
 * List of available icons for the IconPicker component.
 */
export const ICON_LIST = Object.entries(ICON_MAP).map(([name, icon]) => ({
  name,
  icon,
}));

/**
 * Safely retrieves an icon by name, falling back to Lightbulb if not found.
 */
export function getIcon(name: string): IconDefinition {
  return ICON_MAP[name] || faLightbulb;
}

// Re-export commonly used icons for convenience
export {
  faBinoculars,
  faBolt,
  faBuilding,
  faCamera,
  faCameraRetro,
  faCampground,
  faCar,
  faCity,
  faCloud,
  faCloudMoon,
  faCompass,
  faCouch,
  faEye,
  faFire,
  faFireAlt,
  faGem,
  faGlobe,
  faHandSparkles,
  faHeart,
  faHome,
  faLeaf,
  faLightbulb,
  faMapMarkerAlt,
  faMoon,
  faMountain,
  faPalette,
  faRoad,
  faSeedling,
  faSmile,
  faSnowflake,
  faSolarPanel,
  faSpa,
  faStar,
  faStreetView,
  faSun,
  faTools,
  faTree,
  faTruck,
  faUmbrellaBeach,
  faWater,
  faWind,
};


