add attachments

This commit is contained in:
hamid zarghami
2026-02-23 14:44:03 +03:30
parent 3a9c241d45
commit a2dbd843b2
+27 -1
View File
@@ -64,9 +64,35 @@ const RequestDetail: FC = () => {
<div className="mt-6 pt-6 border-t border-dashed border-desc">
<div className="text-sm font-medium mb-2 text-desc">شرح سفارش:</div>
<p className="text-sm font-light text-black leading-6">
{item.description}
{item.description || '—'}
</p>
</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>
)
})