add attachments
This commit is contained in:
@@ -64,9 +64,35 @@ const RequestDetail: FC = () => {
|
|||||||
<div className="mt-6 pt-6 border-t border-dashed border-desc">
|
<div className="mt-6 pt-6 border-t border-dashed border-desc">
|
||||||
<div className="text-sm font-medium mb-2 text-desc">شرح سفارش:</div>
|
<div className="text-sm font-medium mb-2 text-desc">شرح سفارش:</div>
|
||||||
<p className="text-sm font-light text-black leading-6">
|
<p className="text-sm font-light text-black leading-6">
|
||||||
{item.description}
|
{item.description || '—'}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{/* Attachments */}
|
||||||
|
{item.attachments?.length ? (
|
||||||
|
<div className="mt-6 pt-6 border-t border-dashed border-desc">
|
||||||
|
<div className="text-sm font-medium mb-3 text-desc">پیوستها:</div>
|
||||||
|
<div className="flex flex-wrap gap-4">
|
||||||
|
{item.attachments.map((att) => (
|
||||||
|
att.type === 'voice' ? (
|
||||||
|
<div key={att.url} className="flex items-center gap-2 p-3 bg-[#f5f6fa] rounded-xl">
|
||||||
|
<audio controls src={att.url} className="max-w-[240px] h-9" />
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
<a
|
||||||
|
key={att.url}
|
||||||
|
href={att.url}
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
className="block size-20 rounded-lg overflow-hidden border border-desc hover:opacity-90"
|
||||||
|
>
|
||||||
|
<img src={att.url} alt="پیوست" className="size-full object-cover" />
|
||||||
|
</a>
|
||||||
|
)
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user