mirror of
https://git.meshkee.com/Meshkee/dashboards.git
synced 2026-08-11 22:30:58 +04:30
Fix typed condition labels for user-product details pages.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
co-authored by
Cursor
parent
1271d96539
commit
debca2cf99
@@ -174,10 +174,16 @@ export function CustomerProductDetailsPage() {
|
||||
: currency === 'IRT'
|
||||
? formatIrtPrice(product.price)
|
||||
: `${Number(product.price).toLocaleString('en-US')} ${currency}`
|
||||
const conditionKey = product.condition
|
||||
? `customerProducts.form.condition.${product.condition}`
|
||||
: ''
|
||||
const conditionLabel = conditionKey ? t(conditionKey) : '—'
|
||||
const conditionLabel =
|
||||
product.condition === 'new'
|
||||
? t('customerProducts.form.condition.new')
|
||||
: product.condition === 'stock'
|
||||
? t('customerProducts.form.condition.stock')
|
||||
: product.condition === 'needs_repair'
|
||||
? t('customerProducts.form.condition.needs_repair')
|
||||
: product.condition === 'scrap'
|
||||
? t('customerProducts.form.condition.scrap')
|
||||
: '—'
|
||||
|
||||
return (
|
||||
<main className={pageStyles.content}>
|
||||
|
||||
@@ -138,9 +138,16 @@ export function MyProductDetailsPage() {
|
||||
: product.status === 'rejected'
|
||||
? t('myProducts.status.rejected')
|
||||
: t('myProducts.status.pending')
|
||||
const conditionLabel = product.condition
|
||||
? t(`myProducts.condition.${product.condition}`)
|
||||
: '—'
|
||||
const conditionLabel =
|
||||
product.condition === 'new'
|
||||
? t('myProducts.condition.new')
|
||||
: product.condition === 'stock'
|
||||
? t('myProducts.condition.stock')
|
||||
: product.condition === 'needs_repair'
|
||||
? t('myProducts.condition.needs_repair')
|
||||
: product.condition === 'scrap'
|
||||
? t('myProducts.condition.scrap')
|
||||
: '—'
|
||||
const imageSrc = product.imageUrl?.trim() || ''
|
||||
const galleryImages = (product.images ?? [])
|
||||
.map((item) => item.url?.trim())
|
||||
|
||||
Reference in New Issue
Block a user