diff --git a/app/dashboard/page.tsx b/app/dashboard/page.tsx index 7b76c35..a582eac 100644 --- a/app/dashboard/page.tsx +++ b/app/dashboard/page.tsx @@ -3,7 +3,7 @@ import { useEffect, useState } from "react"; import Link from "next/link"; import { useRouter } from "next/navigation"; -import { TrendingUp, Wallet, ArrowUpRight, ArrowDownRight, type LucideIcon } from "lucide-react"; +import { TrendingUp, Wallet, ArrowUpRight, ArrowDownRight, Download, type LucideIcon } from "lucide-react"; import { fetchMe, type DashboardData } from "@/lib/api/client"; import { Button } from "@/components/ui/button"; @@ -155,6 +155,19 @@ export default function DashboardPage() { const { user, funded_bounties, won_bounties, stats } = data; + const handleExportJson = (data: any[], filename: string) => { + const jsonString = JSON.stringify(data, null, 2); + const blob = new Blob([jsonString], { type: "application/json" }); + const href = URL.createObjectURL(blob); + const link = document.createElement("a"); + link.href = href; + link.download = filename; + document.body.appendChild(link); + link.click(); + document.body.removeChild(link); + URL.revokeObjectURL(href); + }; + return (
@@ -192,6 +205,16 @@ export default function DashboardPage() {

Bounties You Funded

+
+ +
{funded_bounties.length === 0 ? ( @@ -214,6 +237,16 @@ export default function DashboardPage() {

Bounties You Won

+
+ +
{won_bounties.length === 0 ? (