fix(navbar): eliminate hardcoded names and make navbar and categories 100% dynamic JSON-driven

This commit is contained in:
2026-11-11 11:20:04 +05:30
parent 4afbf80709
commit 1e675d56fa
6 changed files with 94 additions and 79 deletions
+2 -10
View File
@@ -148,32 +148,27 @@ const CATEGORY_THEMES: Record<
icon: React.ReactNode;
color: string;
badgeBg: string;
description: string;
}
> = {
'portrait-retouch': {
icon: <Smile className="w-4 h-4 text-rose-500" />,
color: 'text-rose-600',
badgeBg: 'bg-rose-500/10 text-rose-700 border-rose-500/20',
description: 'Sub-pore blemish removal, enamel whitening, redness clearing, and radiant studio lighting.',
},
'restoration': {
icon: <Sparkles className="w-4 h-4 text-indigo-500" />,
color: 'text-indigo-600',
badgeBg: 'bg-indigo-500/10 text-indigo-700 border-indigo-500/20',
description: 'Super-resolution 4K deblurring, vintage scratch removal, and authentic archival colorization.',
},
'background-cutout': {
icon: <Scissors className="w-4 h-4 text-emerald-500" />,
color: 'text-emerald-600',
badgeBg: 'bg-emerald-500/10 text-emerald-700 border-emerald-500/20',
description: 'P3M deep learning alpha matting separating hair strands, semi-transparent glass, and edges.',
},
'creative-art': {
icon: <Palette className="w-4 h-4 text-amber-500" />,
color: 'text-amber-600',
badgeBg: 'bg-amber-500/10 text-amber-700 border-amber-500/20',
description: 'Cel-shaded anime synthesis, vintage Polaroid emulsion borders, and object generative fill.',
},
};
@@ -856,8 +851,7 @@ export function ToolGridSection({
</span>
</div>
<p className="text-sm sm:text-base text-ink-2 font-body max-w-2xl mt-1.5 leading-relaxed">
{CATEGORY_THEMES[activeCategoryItem.id]?.description ||
resolveLocalised(activeCategoryItem.category?.description, locale)}
{resolveLocalised(activeCategoryItem.category?.description, locale)}
</p>
</div>
</div>
@@ -954,9 +948,7 @@ export function ToolGridSection({
const catName = group.category
? resolveLocalised(group.category.name, locale)
: group.id;
const catDesc =
theme?.description ||
(group.category ? resolveLocalised(group.category.description, locale) : '');
const catDesc = group.category ? resolveLocalised(group.category.description, locale) : '';
return (
<div