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));
}, [handleReset]);
const handleExport = (action: 'preview' | 'download') => {
// Both actions now use native high-quality browser printing/PDF saving
window.print();
const handleExport = async (action: 'preview' | 'download') => {
if (action === 'download') {
setIsLoading(true);
try {
await exportAsPdf('printable-report-container', 'SteelCheck_Report', 'download');
} finally {
setIsLoading(false);
}
} else {
window.print();
}
};
return (