This commit is contained in:
2026-07-03 10:36:32 +05:30
15 changed files with 460 additions and 96 deletions

View File

@@ -0,0 +1,61 @@
'use client';
import {
Activity,
Construction,
Spline,
CircleDot,
Droplets,
type LucideIcon,
SignpostBig,
} from 'lucide-react';
type DefectVisualConfig = {
icon: LucideIcon;
colorClassName: string;
iconClassName: string;
cardClassName: string;
};
const DEFECT_VISUALS: Record<string, DefectVisualConfig> = {
manhole_cover: {
icon: CircleDot,
colorClassName: 'text-zinc-500',
iconClassName: 'bg-zinc-500/10 text-zinc-500',
cardClassName: 'bg-zinc-500/5',
},
pothole: {
icon: Construction,
colorClassName: 'text-orange-500',
iconClassName: 'bg-orange-500/10 text-orange-500',
cardClassName: 'bg-orange-500/5',
},
road_crack: {
icon: Spline,
colorClassName: 'text-rose-500',
iconClassName: 'bg-rose-500/10 text-rose-500',
cardClassName: 'bg-rose-500/5',
},
sign_board: {
icon: SignpostBig,
colorClassName: 'text-blue-500',
iconClassName: 'bg-blue-500/10 text-blue-500',
cardClassName: 'bg-blue-500/5',
},
water_puddle: {
icon: Droplets,
colorClassName: 'text-cyan-500',
iconClassName: 'bg-cyan-500/10 text-cyan-500',
cardClassName: 'bg-cyan-500/5',
},
};
const DEFAULT_VISUAL: DefectVisualConfig = {
icon: Activity,
colorClassName: 'text-green-500',
iconClassName: 'bg-green-500/10 text-green-500',
cardClassName: 'bg-green-500/5',
};
export const getDefectVisual = (className: string) =>
DEFECT_VISUALS[className] || DEFAULT_VISUAL;