add description and attachment in detail of invoice

This commit is contained in:
hamid zarghami
2026-02-25 09:34:23 +03:30
parent 17b577b0d6
commit dd4063b5da
2 changed files with 28 additions and 2 deletions
+26
View File
@@ -198,6 +198,32 @@ const InvoiceDetail: FC = () => {
<span className='text-[#8C90A3]'>روش پرداخت:</span>
<span className='text-black leading-6'>{invoiceData.paymentMethod}</span>
</div>
{invoice?.description && (
<div className='mt-5 flex flex-col gap-1.5 text-xs'>
<span className='text-[#8C90A3]'>توضیحات:</span>
<span className='text-black leading-6'>{invoice.description}</span>
</div>
)}
{invoice?.attachments && invoice.attachments.length > 0 && (
<div className='mt-5 flex flex-col gap-1.5 text-xs'>
<span className='text-[#8C90A3]'>پیوستها:</span>
<ul className='text-black leading-6 list-disc list-inside space-y-1'>
{invoice.attachments.map((att: unknown, index: number) => {
const url = typeof att === 'string' ? att : (att as { url?: string })?.url
const name = typeof att === 'object' && att && 'name' in (att as object) ? (att as { name?: string }).name : url || `پیوست ${index + 1}`
return url ? (
<li key={index}>
<a href={url} target='_blank' rel='noopener noreferrer' className='text-[#0047FF] hover:underline'>
{name}
</a>
</li>
) : null
})}
</ul>
</div>
)}
</div>
{/* بخش دوم: اقلام درخواستی */}