@@ -2,6 +2,7 @@ import { type FC } from 'react'
|
||||
import type { RequestDetailItemType } from '../types/Types'
|
||||
import { useGetEntityField } from '@/pages/formBuilder/hooks/useFormBuilderData'
|
||||
import { Paperclip2 } from 'iconsax-react'
|
||||
import placeholderProductImage from '@/assets/images/placeholder-product.svg'
|
||||
|
||||
type Props = {
|
||||
item: RequestDetailItemType
|
||||
@@ -37,19 +38,21 @@ const RequestItem: FC<Props> = ({ item }) => {
|
||||
window.open(url, '_blank')
|
||||
}
|
||||
|
||||
const productImage = item.product?.images?.[0]
|
||||
|
||||
return (
|
||||
<div key={item.product?.id} className='border border-border rounded-3xl p-6'>
|
||||
<div className='flex items-center justify-between mb-4'>
|
||||
<div>#{item.id}</div>
|
||||
</div>
|
||||
<div className="flex items-center gap-6">
|
||||
{/* Product Image */}
|
||||
<div className='size-[86px] rounded-lg overflow-hidden bg-gray-100'>
|
||||
{item.product?.images?.[0] ? (
|
||||
<img src={item.product.images[0]} alt={item.product?.title} className='size-full object-cover' />
|
||||
) : (
|
||||
<div className='size-full flex items-center justify-center text-desc text-xs'>بدون تصویر</div>
|
||||
)}
|
||||
<img
|
||||
src={productImage || placeholderProductImage}
|
||||
alt={item.product?.title ?? 'محصول'}
|
||||
className='size-full object-cover'
|
||||
onError={(e) => {
|
||||
e.currentTarget.src = placeholderProductImage
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* Request Details */}
|
||||
|
||||
Reference in New Issue
Block a user