fix: Export-Encoding und Excel-Support
- CSV: UTF-8 BOM + \r\n Zeilenenden → Umlaute in Excel korrekt - CSV: deutsche Spaltennamen, Tags als kommagetrennte Liste - Excel (.xlsx): nativer Export via xlsx-Library mit Spaltenbreiten - Export-Dropdown: CSV und Excel jeweils für aktuelle Ansicht und nur mit E-Mail Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -520,8 +520,8 @@ export default function LeadVaultPage() {
|
||||
}
|
||||
}
|
||||
|
||||
function exportCSV(emailOnly = false) {
|
||||
const params = new URLSearchParams({ search: debouncedSearch, sortBy, sortDir });
|
||||
function exportFile(format: "csv" | "xlsx", emailOnly = false) {
|
||||
const params = new URLSearchParams({ search: debouncedSearch, sortBy, sortDir, format });
|
||||
filterStatus.forEach(s => params.append("status", s));
|
||||
filterSource.forEach(s => params.append("sourceTab", s));
|
||||
if (filterHasEmail) params.set("hasEmail", filterHasEmail);
|
||||
@@ -560,9 +560,10 @@ export default function LeadVaultPage() {
|
||||
</button>
|
||||
<div className="absolute right-0 top-9 hidden group-hover:block z-50 bg-[#1a1a28] border border-[#2e2e3e] rounded-lg shadow-xl p-1 min-w-[220px]">
|
||||
{[
|
||||
["Aktuelle Ansicht (CSV)", () => exportCSV()],
|
||||
["Alle Leads (CSV)", () => exportCSV()],
|
||||
["Nur mit E-Mail (CSV)", () => exportCSV(true)],
|
||||
["Aktuelle Ansicht (CSV)", () => exportFile("csv")],
|
||||
["Aktuelle Ansicht (Excel)", () => exportFile("xlsx")],
|
||||
["Nur mit E-Mail (CSV)", () => exportFile("csv", true)],
|
||||
["Nur mit E-Mail (Excel)", () => exportFile("xlsx", true)],
|
||||
].map(([label, fn]) => (
|
||||
<button key={label as string} onClick={fn as () => void}
|
||||
className="w-full text-left px-3 py-2 text-sm text-gray-300 hover:bg-[#2e2e3e] rounded">
|
||||
|
||||
Reference in New Issue
Block a user