import { IconName } from "@/components/icons/IconPicker"; import { BsPersonWalking } from "react-icons/bs"; import { FaAmazon, FaBicycle, FaBus, FaCarSide, FaCat, FaCheckCircle, FaDog, FaFedex, FaFire, FaUps, } from "react-icons/fa"; import { GiDeer, GiHummingbird } from "react-icons/gi"; import { LuBox, LuLassoSelect } from "react-icons/lu"; import * as LuIcons from "react-icons/lu"; import { MdRecordVoiceOver } from "react-icons/md"; export function isValidIconName(value: string): value is IconName { return Object.keys(LuIcons).includes(value as IconName); } export function getIconForLabel(label: string, className?: string) { if (label.endsWith("-verified")) { return getVerifiedIcon(label, className); } switch (label) { case "bicycle": return ; case "bird": return ; case "bus": return ; case "car": case "vehicle": return ; case "cat": return ; case "deer": return ; case "animal": case "bark": case "dog": return ; case "fire_alarm": return ; case "package": return ; case "person": return ; // audio case "crying": case "laughter": case "scream": case "speech": case "yell": return ; // sub labels case "amazon": return ; case "fedex": return ; case "ups": return ; default: return ; } } function getVerifiedIcon(label: string, className?: string) { const simpleLabel = label.substring(0, label.lastIndexOf("-")); return (
{getIconForLabel(simpleLabel, className)}
); }