fix: deduplicate tool icons and add missing icon mappings

7 icons were shared by multiple tools, now each tool has a unique icon:
- favicon: Globe -> AppWindow
- smart-crop: Focus -> Crosshair
- noise-removal: Sparkles -> AudioLines
- beautify: Sparkles -> ImagePlus
- red-eye-removal: Eye -> ScanEye
- color-palette: Palette -> Droplets
- transparency-fixer: Wand2 -> ShieldCheck
- pdf-to-image: FileOutput -> BookImage

2 icons were missing from the ICON_MAP (falling back to generic FileImage):
- Scaling (content-aware-resize)
- Laugh (meme-generator)
This commit is contained in:
SnapOtter
2026-05-09 00:08:24 +08:00
parent e22ffa4ec9
commit 05cb7c940f
2 changed files with 29 additions and 11 deletions
+21 -3
View File
@@ -1,11 +1,16 @@
import type { LucideIcon } from "lucide-react"; import type { LucideIcon } from "lucide-react";
import { import {
AppWindow,
AudioLines,
BookImage,
CheckCircle2, CheckCircle2,
Code, Code,
Columns, Columns,
Columns2, Columns2,
Copy, Copy,
Crop, Crop,
Crosshair,
Droplets,
Eraser, Eraser,
Eye, Eye,
EyeOff, EyeOff,
@@ -20,7 +25,9 @@ import {
Globe, Globe,
Grid3x3, Grid3x3,
Image, Image,
ImagePlus,
Info, Info,
Laugh,
Layers, Layers,
LayoutGrid, LayoutGrid,
Maximize2, Maximize2,
@@ -31,9 +38,12 @@ import {
Pipette, Pipette,
QrCode, QrCode,
RotateCw, RotateCw,
Scaling,
ScanEye,
ScanFace, ScanFace,
ScanLine, ScanLine,
ScanText, ScanText,
ShieldCheck,
ShieldOff, ShieldOff,
SlidersHorizontal, SlidersHorizontal,
Sparkles, Sparkles,
@@ -52,12 +62,17 @@ import {
// Only the icons actually used by tool definitions in @snapotter/shared constants. // Only the icons actually used by tool definitions in @snapotter/shared constants.
// Avoids `import * as icons from "lucide-react"` which pulls the entire 1000+ icon library. // Avoids `import * as icons from "lucide-react"` which pulls the entire 1000+ icon library.
export const ICON_MAP: Record<string, LucideIcon> = { export const ICON_MAP: Record<string, LucideIcon> = {
AppWindow,
AudioLines,
BookImage,
CheckCircle2, CheckCircle2,
Code, Code,
Columns, Columns,
Columns2, Columns2,
Copy, Copy,
Crop, Crop,
Crosshair,
Droplets,
Eraser, Eraser,
Eye, Eye,
EyeOff, EyeOff,
@@ -68,14 +83,15 @@ export const ICON_MAP: Record<string, LucideIcon> = {
FileType, FileType,
Film, Film,
Focus, Focus,
Frame, Frame,
Globe, Globe,
Grid3x3, Grid3x3,
Image, Image,
ImagePlus,
Info, Info,
LayoutGrid, Laugh,
Layers, Layers,
LayoutGrid,
Maximize2, Maximize2,
Minimize2, Minimize2,
Palette, Palette,
@@ -84,9 +100,12 @@ export const ICON_MAP: Record<string, LucideIcon> = {
Pipette, Pipette,
QrCode, QrCode,
RotateCw, RotateCw,
Scaling,
ScanEye,
ScanFace, ScanFace,
ScanLine, ScanLine,
ScanText, ScanText,
ShieldCheck,
ShieldOff, ShieldOff,
SlidersHorizontal, SlidersHorizontal,
Sparkles, Sparkles,
@@ -97,7 +116,6 @@ export const ICON_MAP: Record<string, LucideIcon> = {
Undo2, Undo2,
UserCheck, UserCheck,
Wand2, Wand2,
Wrench, Wrench,
Zap, Zap,
ZoomIn, ZoomIn,
+8 -8
View File
@@ -100,7 +100,7 @@ export const TOOLS: Tool[] = [
name: "Favicon Generator", name: "Favicon Generator",
description: "Generate all favicon and app icon sizes", description: "Generate all favicon and app icon sizes",
category: "optimization", category: "optimization",
icon: "Globe", icon: "AppWindow",
route: "/favicon", route: "/favicon",
}, },
// Adjustments // Adjustments
@@ -182,7 +182,7 @@ export const TOOLS: Tool[] = [
name: "Smart Crop", name: "Smart Crop",
description: "Smart subject, face, or trim-based cropping", description: "Smart subject, face, or trim-based cropping",
category: "ai", category: "ai",
icon: "Focus", icon: "Crosshair",
route: "/smart-crop", route: "/smart-crop",
}, },
{ {
@@ -214,7 +214,7 @@ export const TOOLS: Tool[] = [
name: "Noise Removal", name: "Noise Removal",
description: "AI-powered noise and grain removal", description: "AI-powered noise and grain removal",
category: "ai", category: "ai",
icon: "Sparkles", icon: "AudioLines",
route: "/noise-removal", route: "/noise-removal",
}, },
{ {
@@ -222,7 +222,7 @@ export const TOOLS: Tool[] = [
name: "Red Eye Removal", name: "Red Eye Removal",
description: "AI-detect and fix red eye in flash photos", description: "AI-detect and fix red eye in flash photos",
category: "ai", category: "ai",
icon: "Eye", icon: "ScanEye",
route: "/red-eye-removal", route: "/red-eye-removal",
}, },
{ {
@@ -254,7 +254,7 @@ export const TOOLS: Tool[] = [
name: "PNG Transparency Fixer", name: "PNG Transparency Fixer",
description: "Fix fake transparent PNGs in one click", description: "Fix fake transparent PNGs in one click",
category: "ai", category: "ai",
icon: "Wand2", icon: "ShieldCheck",
route: "/transparency-fixer", route: "/transparency-fixer",
}, },
// Watermark & Overlay // Watermark & Overlay
@@ -328,7 +328,7 @@ export const TOOLS: Tool[] = [
name: "Color Palette", name: "Color Palette",
description: "Extract dominant colors from image", description: "Extract dominant colors from image",
category: "utilities", category: "utilities",
icon: "Palette", icon: "Droplets",
route: "/color-palette", route: "/color-palette",
}, },
{ {
@@ -393,7 +393,7 @@ export const TOOLS: Tool[] = [
name: "Beautify Screenshot", name: "Beautify Screenshot",
description: "Add gradient backgrounds, device frames, shadows, and social media sizing", description: "Add gradient backgrounds, device frames, shadows, and social media sizing",
category: "layout", category: "layout",
icon: "Sparkles", icon: "ImagePlus",
route: "/beautify", route: "/beautify",
}, },
// Format & Conversion // Format & Conversion
@@ -427,7 +427,7 @@ export const TOOLS: Tool[] = [
name: "PDF to Image", name: "PDF to Image",
description: "Convert PDF pages to images", description: "Convert PDF pages to images",
category: "format", category: "format",
icon: "FileOutput", icon: "BookImage",
route: "/pdf-to-image", route: "/pdf-to-image",
}, },
]; ];