import { type FC } from 'react' import { useParams } from 'react-router-dom' import { useGetRequestDetails } from './hooks/useRequestData' import TicketSection from './components/TicketSection' import placeholderProductImage from '@/assets/images/placeholder-product.svg' const RequestDetail: FC = () => { const { id } = useParams() const { data } = useGetRequestDetails(id!) return (
{/* Header Section */}
درخواست #{data?.data?.requestNumber}
{/* Order Information Section */}

اطلاعات درخواست

{ data?.data?.items?.map((item) => { const productImage = item.product?.images?.[0] return (
{/* Product Image */}
{item.product?.title { e.currentTarget.src = placeholderProductImage }} />
{/* Order Details */}
عنوان:
{item.product.title}
{/* Order Description */}
شرح درخواست:

{item.description || '—'}

{/* Attributes from field */} {item.attributes?.length ? ( <>
ویژگی‌ها
{item.attributes.map((attr) => (
{attr.field?.name}:
{attr.value ?? '—'}
))}
) : null} {/* Attachments */} {item.attachments?.length ? (
پیوست‌ها:
{item.attachments.map((att) => ( att.type === 'voice' ? (
) : ( پیوست ) ))}
) : null}
) }) }
{/* Bottom Section - White Card */}
) } export default RequestDetail