- améliore l'export/import (format de fichiers en paramètres, amélioration de la robustesse, )
- ajout bouton tout effacer des propositions et participants
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
import { useState } from 'react';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Download, FileSpreadsheet } from 'lucide-react';
|
||||
import { generateVoteExportODS, downloadODS, formatFilename, ExportData, AnonymizationLevel } from '@/lib/export-utils';
|
||||
import { generateVoteExport, downloadExportFile, formatFilename, ExportData, AnonymizationLevel } from '@/lib/export-utils';
|
||||
import { settingsService } from '@/lib/services';
|
||||
|
||||
interface ExportStatsButtonProps {
|
||||
@@ -46,10 +46,10 @@ export function ExportStatsButton({
|
||||
anonymizationLevel
|
||||
};
|
||||
|
||||
const odsData = generateVoteExportODS(exportData);
|
||||
const filename = formatFilename(campaignTitle);
|
||||
const { data, format } = await generateVoteExport(exportData);
|
||||
const filename = formatFilename(campaignTitle, format);
|
||||
|
||||
downloadODS(odsData, filename);
|
||||
downloadExportFile(data, filename, format);
|
||||
} catch (error) {
|
||||
console.error('Erreur lors de l\'export:', error);
|
||||
// Ici on pourrait ajouter une notification d'erreur
|
||||
@@ -75,7 +75,7 @@ export function ExportStatsButton({
|
||||
) : (
|
||||
<>
|
||||
<FileSpreadsheet className="h-4 w-4" />
|
||||
Exporter les votes (ODS)
|
||||
Exporter les votes
|
||||
</>
|
||||
)}
|
||||
</Button>
|
||||
|
||||
Reference in New Issue
Block a user