Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

fix(billing): conditionally render download button for paid invoices

Victor Hugo dos Santos66758f3762ad
diff --git a/frontend/src/pages/organization/BillingPage/components/BillingReceiptsTab/InvoicesTable.tsx b/frontend/src/pages/organization/BillingPage/components/BillingReceiptsTab/InvoicesTable.tsx
index 1f67a5cdda..894a6316af 100644
--- a/frontend/src/pages/organization/BillingPage/components/BillingReceiptsTab/InvoicesTable.tsx
+++ b/frontend/src/pages/organization/BillingPage/components/BillingReceiptsTab/InvoicesTable.tsx
@@ -53,14 +53,16 @@ export const InvoicesTable = () => {
<Td>{paid ? "Paid" : "Not Paid"}</Td>
<Td>{formattedTotal}</Td>
<Td>
- <IconButton
- onClick={async () => window.open(invoice_pdf)}
- size="lg"
- variant="plain"
- ariaLabel="update"
- >
- <FontAwesomeIcon icon={faDownload} />
- </IconButton>
+ {paid && (
+ <IconButton
+ onClick={async () => window.open(invoice_pdf)}
+ size="lg"
+ variant="plain"
+ ariaLabel="download invoice"
+ >
+ <FontAwesomeIcon icon={faDownload} />
+ </IconButton>
+ )}
</Td>
</Tr>
);