Skip to content

Commit

Permalink
prettier fix
Browse files Browse the repository at this point in the history
  • Loading branch information
danilomartinss committed Dec 19, 2024
1 parent b867805 commit 651578d
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions src/lib/data/csvExport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,14 @@ const DownloadCSV = <T extends Record<string, any>>(
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;

0 comments on commit 651578d

Please sign in to comment.