Replace mock Google Sheet link with instant local CSV spreadsheet download generator
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user