fix: restore direct pdf download for baixar relatorio button

This commit is contained in:
2026-06-23 17:33:04 +00:00
parent 5d5d2266f8
commit c0b3d5c68d
+11 -3
View File
@@ -185,9 +185,17 @@ const App: React.FC = () => {
}).catch(err => console.error('Erro ao limpar configurações no servidor:', err)); }).catch(err => console.error('Erro ao limpar configurações no servidor:', err));
}, [handleReset]); }, [handleReset]);
const handleExport = (action: 'preview' | 'download') => { const handleExport = async (action: 'preview' | 'download') => {
// Both actions now use native high-quality browser printing/PDF saving if (action === 'download') {
window.print(); setIsLoading(true);
try {
await exportAsPdf('printable-report-container', 'SteelCheck_Report', 'download');
} finally {
setIsLoading(false);
}
} else {
window.print();
}
}; };
return ( return (