import { FileSpreadsheet, FileText, FileJson, Check, Package } from 'lucide-react'; import toast from 'react-hot-toast'; import type { DataRow } from '../utils/xlsxExporter'; import { exportToXlsx, exportToTsv, exportToJsonl } from '../utils/xlsxExporter'; interface ExportPanelProps { data: DataRow[]; } export default function ExportPanel({ data }: ExportPanelProps) { const handleExportXlsx = () => { if (data.length === 0) { toast.error('No data to export'); return; } try { exportToXlsx(data); toast.success(`📊 Exported ${data.length} rows to XLSX`, { icon: '✅' }); } catch (error) { toast.error('Export failed'); console.error(error); } }; const handleExportTsv = () => { if (data.length === 0) { toast.error('No data to export'); return; } try { exportToTsv(data); toast.success(`📄 Exported ${data.length} rows to TSV`, { icon: '✅' }); } catch (error) { toast.error('Export failed'); console.error(error); } }; const handleExportJsonl = () => { if (data.length === 0) { toast.error('No data to export'); return; } try { exportToJsonl(data); toast.success(`📋 Exported ${data.length} rows to JSONL`, { icon: '✅' }); } catch (error) { toast.error('Export failed'); console.error(error); } }; const isDisabled = data.length === 0; return (

Export Dataset

{data.length > 0 && (

Ready to export {data.length} parallel text pairs

)}
); }