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));
|
||||
}, [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 (
|
||||
|
||||
Reference in New Issue
Block a user