fix(invoices): wrap the Visa PDF handler so the click event is not read as options (#2403)

The review pass on #2401 gave previewPDF an options parameter but left the
button's onClick as a bare reference, so TypeScript saw a MouseEvent flowing
into { asDraft?: boolean } and the production build failed (Core Build and
the Vercel deploy on 4e8d649b2). Prod stayed on the previous deploy.

Refs #2399


Claude-Session: https://claude.ai/code/session_01RZiqSg2v6XrtaFZyyRK88b

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
Mattsson
2026-09-08 01:32:21 +02:00
committed by GitHub
parent 4e8d649b2f
commit 25b969183c
+1 -1
View File
@@ -1778,7 +1778,7 @@ export default function InvoiceDetailPage({ params }: { params: Promise<{ id: st
)}
{/* Review in the browser (#1190); the download lives in the menu. */}
{!isSelfBilled && (
<Button variant="outline" onClick={previewPDF}>
<Button variant="outline" onClick={() => previewPDF()}>
<Eye className="mr-2 h-4 w-4" />
{t('preview_pdf')}
</Button>