diff --git a/src/lib/data/csvExport.ts b/src/lib/data/csvExport.ts index 260718b..7f48779 100644 --- a/src/lib/data/csvExport.ts +++ b/src/lib/data/csvExport.ts @@ -16,15 +16,14 @@ const DownloadCSV = >( return [header, ...rows].join("\n"); }; - const csvContent = convertToCSV(data); - const blob = new Blob([csvContent], { type: "text/csv;charset=utf-8;" }); - const url = URL.createObjectURL(blob); - const link = document.createElement('a'); - link.setAttribute('href', url); - link.setAttribute('download', `${fileName}.csv`); - link.click(); - URL.revokeObjectURL(url); + const csvContent = convertToCSV(data); + const blob = new Blob([csvContent], { type: "text/csv;charset=utf-8;" }); + const url = URL.createObjectURL(blob); + const link = document.createElement("a"); + link.setAttribute("href", url); + link.setAttribute("download", `${fileName}.csv`); + link.click(); + URL.revokeObjectURL(url); }; export default DownloadCSV; -