diff --git a/apps/admin/src/pages/PageBuilderPage.tsx b/apps/admin/src/pages/PageBuilderPage.tsx index 97b1fd8..45950fb 100644 --- a/apps/admin/src/pages/PageBuilderPage.tsx +++ b/apps/admin/src/pages/PageBuilderPage.tsx @@ -1471,7 +1471,7 @@ export default function PageBuilderPage() { }} className="accent-cyan-glow" /> - {cat.name} + {typeof cat.name === 'string' ? cat.name : (cat.name as any)?.th || (cat.name as any)?.en || ''} ); })} diff --git a/apps/admin/src/pages/ProductEditPage.tsx b/apps/admin/src/pages/ProductEditPage.tsx index f01f137..1a5505d 100644 --- a/apps/admin/src/pages/ProductEditPage.tsx +++ b/apps/admin/src/pages/ProductEditPage.tsx @@ -372,7 +372,7 @@ export default function ProductEditPage() { className="w-full px-4 py-3 bg-night-950 border border-white/10 focus:border-cyan-glow/40 rounded-xl outline-none text-sm text-white transition-all appearance-none cursor-pointer" > {categories.map(c => ( - + ))} @@ -612,13 +612,13 @@ export default function ProductEditPage() { {/* Main Image Preview */}
img.url)?.url ? fixUrl(images.find(img => img.url)!.url!) : getCategoryImage(product?.category.name || '')} + src={images.find(img => img.url)?.url ? fixUrl(images.find(img => img.url)!.url!) : getCategoryImage(typeof product?.category.name === 'string' ? product.category.name : (product?.category.name as any)?.en || '')} className="w-full h-full object-contain transition-all duration-700" alt="" />
-

{product?.category.name}

+

{typeof product?.category.name === 'string' ? product.category.name : (product?.category.name as any)?.th || (product?.category.name as any)?.en || ''}

{product?.scent.name}

diff --git a/apps/admin/src/pages/ProductsPage.tsx b/apps/admin/src/pages/ProductsPage.tsx index c2ccaa0..bfcd090 100644 --- a/apps/admin/src/pages/ProductsPage.tsx +++ b/apps/admin/src/pages/ProductsPage.tsx @@ -264,7 +264,7 @@ export default function ProductsPage() { > {categories.map(c => ( - + ))}
@@ -307,7 +307,7 @@ export default function ProductsPage() { 0 ? fixUrl(product.images[0].url) - : getCategoryImage(product.category.name)} + : getCategoryImage(typeof product.category.name === 'string' ? product.category.name : (product.category.name as any)?.en || '')} alt="" className="w-full h-full object-contain grayscale-0 opacity-100 group-hover:scale-110 transition-all duration-500" /> @@ -320,7 +320,7 @@ export default function ProductsPage() { - {product.category.name} + {typeof product.category.name === 'string' ? product.category.name : (product.category.name as any)?.th || (product.category.name as any)?.en || ''} @@ -445,7 +445,7 @@ export default function ProductsPage() {

{selectedProduct.scent.name}

-

{selectedProduct.category.name} Gallery

+

{typeof selectedProduct.category.name === 'string' ? selectedProduct.category.name : (selectedProduct.category.name as any)?.th || (selectedProduct.category.name as any)?.en || ''} Gallery