forked from PinSpace-Org/GistPin
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExcelExportButton.tsx
More file actions
42 lines (37 loc) 路 1.09 KB
/
Copy pathExcelExportButton.tsx
File metadata and controls
42 lines (37 loc) 路 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
'use client';
import { useState } from 'react';
import { downloadAnalyticsWorkbook } from '@/lib/excel-export';
export default function ExcelExportButton() {
const [status, setStatus] = useState<string | null>(null);
const handleExport = () => {
downloadAnalyticsWorkbook();
setStatus('Workbook generated with Overview, Users, Locations, and Engagement sheets.');
window.setTimeout(() => setStatus(null), 1500);
};
return (
<div style={{ display: 'flex', flexDirection: 'column', alignItems: 'flex-end', gap: 8 }}>
<button
type="button"
onClick={handleExport}
style={{
border: 'none',
borderRadius: 999,
background: '#166534',
color: '#ffffff',
padding: '12px 18px',
fontSize: 14,
fontWeight: 700,
cursor: 'pointer',
boxShadow: '0 12px 30px rgba(22,101,52,0.20)',
}}
>
Download Excel Workbook
</button>
{status && (
<span style={{ fontSize: 12, color: '#166534' }}>
{status}
</span>
)}
</div>
);
}