fix(admin): safely resolve category name for Category | string union type on product list row
This commit is contained in:
parent
bf213bb05d
commit
68c7656964
@ -347,7 +347,11 @@ export default function Products() {
|
||||
{product.nameEn && <span className="text-xs text-gray-400 font-mono" dir="ltr">{product.nameEn}</span>}
|
||||
</div>
|
||||
</td>
|
||||
<td className="py-4 px-6 text-gray-600 text-sm">{product.category?.name || 'بدون دسته'}</td>
|
||||
<td className="py-4 px-6 text-gray-600 text-sm">
|
||||
{typeof product.category === 'object' && product.category !== null
|
||||
? (product.category.nameFa || product.category.name || 'بدون دسته')
|
||||
: (product.category || 'بدون دسته')}
|
||||
</td>
|
||||
<td className="py-4 px-6">
|
||||
<div className="flex flex-col">
|
||||
<span className="font-bold text-gray-900">{Number(product.priceValue).toLocaleString()} تومان</span>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user