fix: resolve website typescript errors from category i18n

This commit is contained in:
Your Name committed 2026-06-14 00:10:19 -04:00
1 parent 93012a3bdf
commit 363be70e11
8 files changed
+25 -25

No files matched your search

@@ -30,7 +30,7 @@ export default function AddToCartSection({ product }: Props) {
price: currentVariant.price || product.price || 0,
productName: product.scent.name,
variantSize: currentVariant.size,
productImage: product.images?.[0]?.url || product.category.imageUrl || getCategoryImage(product.category.name),
productImage: product.images?.[0]?.url || product.category.imageUrl || getCategoryImage(typeof product.category.name === 'string' ? product.category.name : (product.category.name as any)?.th || (product.category.name as any)?.en || ''),
})
toggleCart(true)
}
@@ -41,7 +41,7 @@ export default function AddToCartSection({ product }: Props) {
<div className="space-y-8">
<div className="space-y-2">
<p className="text-cyan-glow uppercase tracking-[0.3em] text-xs font-semibold opacity-80">
{product.category.name}
{typeof product.category.name === 'string' ? product.category.name : (product.category.name as any)?.th || (product.category.name as any)?.en || ''}
</p>
<h1 className="text-5xl font-bold leading-tight">{product.scent.name}</h1>
<p className="text-slate-400 text-sm uppercase tracking-widest">Premium Collection</p>
@@ -108,7 +108,7 @@ export default function AddToCartSection({ product }: Props) {
<div>
<span className="text-xs uppercase tracking-widest block mb-1">Category</span>
<Link href={`/category/${product.category.id}`} className="text-white font-medium hover:text-cyan-glow transition-colors">
{product.category.name}
{typeof product.category.name === 'string' ? product.category.name : (product.category.name as any)?.th || (product.category.name as any)?.en || ''}
</Link>
</div>
</div>