Replace mock Google Sheet link with instant local CSV spreadsheet download generator

This commit is contained in:
2026-07-22 19:41:28 -04:00
parent 89b49be58d
commit 6ba84ba37e
3 changed files with 35 additions and 48 deletions
+12 -1
View File
@@ -178,7 +178,18 @@ export const GoogleWorkspaceHub: React.FC<GoogleWorkspaceHubProps> = ({
url: res.spreadsheetUrl,
time: new Date().toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' })
});
showToast('Exported tracker data directly to Google Sheets!');
if (res.isLocalCsv && res.spreadsheetUrl) {
const link = document.createElement('a');
link.href = res.spreadsheetUrl;
link.download = `AI_Job_Applications_Tracker_${new Date().toISOString().split('T')[0]}.csv`;
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
showToast('✓ Applications exported & downloaded to Spreadsheet CSV file!');
} else {
showToast(res.message || 'Exported applications to Google Sheets!');
}
} catch (err: any) {
showToast(`Sheets Export: ${err.message || 'Prepared export file'}`);
} finally {