hailsbop commited on
Commit
ca8ac40
·
verified ·
1 Parent(s): bcada48

Upload components/ExportControls.js with huggingface_hub

Browse files
Files changed (1) hide show
  1. components/ExportControls.js +44 -0
components/ExportControls.js ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { FileJson, FileText, Download } from 'lucide-react';
2
+
3
+ export default function ExportControls({ count, onExport, exporting, progress }) {
4
+ if (count === 0) return null;
5
+
6
+ return (
7
+ <div className="bg-slate-800 border border-slate-700 rounded-xl p-4 mb-6 flex items-center justify-between shadow-lg">
8
+ <div className="flex items-center gap-4">
9
+ <div className="bg-blue-500/20 text-blue-400 px-3 py-1 rounded font-mono text-sm">
10
+ {count} Selected
11
+ </div>
12
+ <span className="text-slate-400 text-sm">Ready for batch export</span>
13
+ </div>
14
+
15
+ <div className="flex gap-3">
16
+ <button
17
+ onClick={() => onExport('json')}
18
+ disabled={exporting}
19
+ className="flex items-center gap-2 px-4 py-2 bg-slate-700 hover:bg-slate-600 text-white rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed"
20
+ >
21
+ <FileJson size={18} />
22
+ JSON
23
+ </button>
24
+ <button
25
+ onClick={() => onExport('csv')}
26
+ disabled={exporting}
27
+ className="flex items-center gap-2 px-4 py-2 bg-slate-700 hover:bg-slate-600 text-white rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed"
28
+ >
29
+ <FileText size={18} />
30
+ CSV
31
+ </button>
32
+ </div>
33
+
34
+ {exporting && (
35
+ <div className="absolute bottom-0 left-0 w-full h-2 bg-slate-900 rounded-b overflow-hidden">
36
+ <div
37
+ className="h-full bg-blue-500 transition-all duration-300 ease-out"
38
+ style={{ width: `${progress}%` }}
39
+ />
40
+ </div>
41
+ )}
42
+ </div>
43
+ );
44
+ }