- Alle Seiten (AirScale, LinkedIn, SERP, Ergebnisse, Einstellungen) auf Deutsch - Gemeinsame Komponenten übersetzt: StatusBadge, ResultsTable-Spalten, FileDropZone, ExportButtons - Sidebar API-Status-Label und TopBar-Breadcrumbs auf Deutsch - Alle Toast-Nachrichten und Fehlermeldungen auf Deutsch Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
39 lines
1.3 KiB
TypeScript
39 lines
1.3 KiB
TypeScript
"use client";
|
|
|
|
import { Button } from "@/components/ui/button";
|
|
import { Download, FileSpreadsheet } from "lucide-react";
|
|
import { exportToCSV, exportToExcel, type ExportRow } from "@/lib/utils/csv";
|
|
|
|
interface ExportButtonsProps {
|
|
rows: ExportRow[];
|
|
filename: string;
|
|
disabled?: boolean;
|
|
summary?: string;
|
|
}
|
|
|
|
export function ExportButtons({ rows, filename, disabled, summary }: ExportButtonsProps) {
|
|
return (
|
|
<div className="flex items-center gap-3 flex-wrap">
|
|
{summary && <span className="text-sm text-gray-400">{summary}</span>}
|
|
<Button
|
|
variant="outline"
|
|
size="sm"
|
|
disabled={disabled || rows.length === 0}
|
|
onClick={() => exportToCSV(rows, `${filename}.csv`)}
|
|
className="border-[#2e2e3e] hover:border-blue-500/50 hover:bg-blue-500/5 text-gray-300"
|
|
>
|
|
<Download className="w-4 h-4 mr-1.5" /> CSV herunterladen
|
|
</Button>
|
|
<Button
|
|
variant="outline"
|
|
size="sm"
|
|
disabled={disabled || rows.length === 0}
|
|
onClick={() => exportToExcel(rows, `${filename}.xlsx`)}
|
|
className="border-[#2e2e3e] hover:border-purple-500/50 hover:bg-purple-500/5 text-gray-300"
|
|
>
|
|
<FileSpreadsheet className="w-4 h-4 mr-1.5" /> Excel herunterladen
|
|
</Button>
|
|
</div>
|
|
);
|
|
}
|