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 {
AppWindow,
AudioLines,
BookImage,
CheckCircle2,
Code,
Columns,
Columns2,
Copy,
Crop,
Crosshair,
Droplets,
Eraser,
Eye,
EyeOff,
@@ -20,7 +25,9 @@ import {
Globe,
Grid3x3,
Image,
ImagePlus,
Info,
Laugh,
Layers,
LayoutGrid,
Maximize2,
@@ -31,9 +38,12 @@ import {
Pipette,
QrCode,
RotateCw,
Scaling,
ScanEye,
ScanFace,
ScanLine,
ScanText,
ShieldCheck,
ShieldOff,
SlidersHorizontal,
Sparkles,
@@ -52,12 +62,17 @@ import {
// 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.
export const ICON_MAP: Record<string, LucideIcon> = {
AppWindow,
AudioLines,
BookImage,
CheckCircle2,
Code,
Columns,
Columns2,
Copy,
Crop,
Crosshair,
Droplets,
Eraser,
Eye,
EyeOff,
@@ -68,14 +83,15 @@ export const ICON_MAP: Record<string, LucideIcon> = {
FileType,
Film,
Focus,
Frame,
Globe,
Grid3x3,
Image,
ImagePlus,
Info,
LayoutGrid,
Laugh,
Layers,
LayoutGrid,
Maximize2,
Minimize2,
Palette,
@@ -84,9 +100,12 @@ export const ICON_MAP: Record<string, LucideIcon> = {
Pipette,
QrCode,
RotateCw,
Scaling,
ScanEye,
ScanFace,
ScanLine,
ScanText,
ShieldCheck,
ShieldOff,
SlidersHorizontal,
Sparkles,
@@ -97,7 +116,6 @@ export const ICON_MAP: Record<string, LucideIcon> = {
Undo2,
UserCheck,
Wand2,
Wrench,
Zap,
ZoomIn,
+8 -8
View File
@@ -100,7 +100,7 @@ export const TOOLS: Tool[] = [
name: "Favicon Generator",
description: "Generate all favicon and app icon sizes",
category: "optimization",
icon: "Globe",
icon: "AppWindow",
route: "/favicon",
},
// Adjustments
@@ -182,7 +182,7 @@ export const TOOLS: Tool[] = [
name: "Smart Crop",
description: "Smart subject, face, or trim-based cropping",
category: "ai",
icon: "Focus",
icon: "Crosshair",
route: "/smart-crop",
},
{
@@ -214,7 +214,7 @@ export const TOOLS: Tool[] = [
name: "Noise Removal",
description: "AI-powered noise and grain removal",
category: "ai",
icon: "Sparkles",
icon: "AudioLines",
route: "/noise-removal",
},
{
@@ -222,7 +222,7 @@ export const TOOLS: Tool[] = [
name: "Red Eye Removal",
description: "AI-detect and fix red eye in flash photos",
category: "ai",
icon: "Eye",
icon: "ScanEye",
route: "/red-eye-removal",
},
{
@@ -254,7 +254,7 @@ export const TOOLS: Tool[] = [
name: "PNG Transparency Fixer",
description: "Fix fake transparent PNGs in one click",
category: "ai",
icon: "Wand2",
icon: "ShieldCheck",
route: "/transparency-fixer",
},
// Watermark & Overlay
@@ -328,7 +328,7 @@ export const TOOLS: Tool[] = [
name: "Color Palette",
description: "Extract dominant colors from image",
category: "utilities",
icon: "Palette",
icon: "Droplets",
route: "/color-palette",
},
{
@@ -393,7 +393,7 @@ export const TOOLS: Tool[] = [
name: "Beautify Screenshot",
description: "Add gradient backgrounds, device frames, shadows, and social media sizing",
category: "layout",
icon: "Sparkles",
icon: "ImagePlus",
route: "/beautify",
},
// Format & Conversion
@@ -427,7 +427,7 @@ export const TOOLS: Tool[] = [
name: "PDF to Image",
description: "Convert PDF pages to images",
category: "format",
icon: "FileOutput",
icon: "BookImage",
route: "/pdf-to-image",
},
];