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'
|
: currency === 'IRT'
|
||||||
? formatIrtPrice(product.price)
|
? formatIrtPrice(product.price)
|
||||||
: `${Number(product.price).toLocaleString('en-US')} ${currency}`
|
: `${Number(product.price).toLocaleString('en-US')} ${currency}`
|
||||||
const conditionKey = product.condition
|
const conditionLabel =
|
||||||
? `customerProducts.form.condition.${product.condition}`
|
product.condition === 'new'
|
||||||
: ''
|
? t('customerProducts.form.condition.new')
|
||||||
const conditionLabel = conditionKey ? t(conditionKey) : '—'
|
: 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 (
|
return (
|
||||||
<main className={pageStyles.content}>
|
<main className={pageStyles.content}>
|
||||||
|
|||||||
@@ -138,9 +138,16 @@ export function MyProductDetailsPage() {
|
|||||||
: product.status === 'rejected'
|
: product.status === 'rejected'
|
||||||
? t('myProducts.status.rejected')
|
? t('myProducts.status.rejected')
|
||||||
: t('myProducts.status.pending')
|
: t('myProducts.status.pending')
|
||||||
const conditionLabel = product.condition
|
const conditionLabel =
|
||||||
? t(`myProducts.condition.${product.condition}`)
|
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 imageSrc = product.imageUrl?.trim() || ''
|
||||||
const galleryImages = (product.images ?? [])
|
const galleryImages = (product.images ?? [])
|
||||||
.map((item) => item.url?.trim())
|
.map((item) => item.url?.trim())
|
||||||
|
|||||||
Reference in New Issue
Block a user