added supabase

This commit is contained in:
Austin
2026-02-20 09:12:47 -06:00
parent 3c293159ff
commit 76f1241761
54 changed files with 3162 additions and 445 deletions
@@ -0,0 +1,34 @@
"use client";
interface ExportButtonProps {
subscriptions: { email: string; created_at: string }[];
}
export default function ExportButton({ subscriptions }: ExportButtonProps) {
const handleExport = () => {
const csv = [
"email,subscribed_date",
...subscriptions.map(
(s) =>
`${s.email},${new Date(s.created_at).toISOString().split("T")[0]}`
),
].join("\n");
const blob = new Blob([csv], { type: "text/csv" });
const url = URL.createObjectURL(blob);
const a = document.createElement("a");
a.href = url;
a.download = "subscriptions.csv";
a.click();
URL.revokeObjectURL(url);
};
return (
<button
onClick={handleExport}
className="bg-gray-800 text-white px-4 py-2 rounded-md hover:bg-gray-700"
>
Export CSV
</button>
);
}