"use client"; import Image from "next/image"; import { Card, CardContent, CardDescription, CardHeader, CardTitle, } from "@/components/ui/card"; import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; import { Overview } from "@/components/ui/overview"; import { RecentFunds } from "@/components/recent-funds"; import { useState } from "react"; import { useDealList } from "./hook"; export default function Dashboard() { const [graphType, setGraphType] = useState("line"); const dealList = useDealList(); const totalDealAmount = dealList?.reduce((sum, deal) => sum + deal.deal_amount, 0) || 0; return ( <> {dealList?.map((deal, index) => (

Deal Amount: {deal.deal_amount}

Created Time: {new Date(deal.created_time).toUTCString()}

Investor ID: {deal.investor_id}

))}
Dashboard Dashboard

Business Dashboard

Overview Analytics
Total Funds Raised
${totalDealAmount}
{/*

+20.1% from last month

*/}
Profile Views
+2350
{/*

+180.1% from last month

*/}
Total Followers
+12,234
{/*

+19% from last month

*/}
{/* Active Now
+573

+201 since last hour

*/}
Overview {/* tab to switch between line and bar graph */} setGraphType("line")} > Line setGraphType("bar")} > Bar Recent Funds You made {dealList?.length || 0} sales this month.
); }