Skip to content

Commit

Permalink
Refactor PDF download button in OccupancyModal component
Browse files Browse the repository at this point in the history
  • Loading branch information
waveyboym committed Sep 30, 2024
1 parent 1218813 commit 6f50e9e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions frontend/occupi-web/src/components/modal/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -339,14 +339,15 @@ export default function OccupancyModal({ user }: OccupancyModalProps) {
</Button>
{reportData ? (
<Button className="bg-text_col_secondary_alt ">
{/* @ts-ignore */}
<PDFDownloadLink
className="text-text_col_alt bg-secondary-alt "
document={generateReportPDF()}
fileName={`${user.name}_Stats_Report.pdf`}
>
{({ loading }: { loading: boolean }) => (
<>{loading ? "Generating PDF..." : "Download PDF Report"}</>
)}
{({ loading }) =>
loading ? "Generating PDF..." : "Download PDF Report"
}
</PDFDownloadLink>
</Button>
) : (
Expand Down

0 comments on commit 6f50e9e

Please sign in to comment.