fix: restore direct pdf download for baixar relatorio button
This commit is contained in:
@@ -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 (
|
||||||
|
|||||||
Reference in New Issue
Block a user