diff --git a/src/app/portfolio/[uid]/hook.ts b/src/app/portfolio/[uid]/hook.ts index ac145ab..d624cbf 100644 --- a/src/app/portfolio/[uid]/hook.ts +++ b/src/app/portfolio/[uid]/hook.ts @@ -5,7 +5,7 @@ async function checkForInvest(supabase: SupabaseClient, userId: string) { let { count, error } = await supabase .from("investment_deal") .select("*", { count: "exact" }) - .eq("investor_id", "8as1761d2"); + .eq("investor_id", userId); if (error) { console.error(error); return false; diff --git a/src/app/portfolio/[uid]/page.tsx b/src/app/portfolio/[uid]/page.tsx index 5917e6c..367407b 100644 --- a/src/app/portfolio/[uid]/page.tsx +++ b/src/app/portfolio/[uid]/page.tsx @@ -14,6 +14,8 @@ import { } from "./hook"; import CountUpComponent from "@/components/countUp"; import { RecentFunds } from "@/components/recent-funds"; +import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; +import QuestionMarkIcon from "@/components/icon/questionMark"; export default async function Portfolio({ params, @@ -21,7 +23,9 @@ export default async function Portfolio({ params: { uid: string }; }) { const supabase = createSupabaseClient(); - await checkForInvest(supabase, params.uid); + // if user hasn't invest in anything + if (!(await checkForInvest(supabase, params.uid))) { + } const { data: deals, error: investorDealError } = await getInvestorDeal( supabase, params.uid @@ -67,27 +71,41 @@ export default async function Portfolio({ -
-
-

Project tag

- item.count - )} - labels={tagCount.map( - (item: { name: string; count: number }) => item.name - )} - header="Total" - /> -
-
-

Business Type

- -
+
+ + + + Categories of Invested Projects + + + + + item.count + )} + labels={tagCount.map( + (item: { name: string; count: number }) => item.name + )} + header="Total" + /> + + + + + + Categories of Invested Projects + + + + + + +
diff --git a/src/components/icon/questionMark.tsx b/src/components/icon/questionMark.tsx new file mode 100644 index 0000000..0af645d --- /dev/null +++ b/src/components/icon/questionMark.tsx @@ -0,0 +1,16 @@ +export default function QuestionMarkIcon() { + return ( + + + + + + ); +}