diff --git a/src/app/dashboard/page.tsx b/src/app/dashboard/page.tsx index 3c678c3..21f9dd1 100644 --- a/src/app/dashboard/page.tsx +++ b/src/app/dashboard/page.tsx @@ -93,13 +93,13 @@ export default function Dashboard() { const fetchProjects = async () => { if (userId) { const { data, error } = await getProjectByUserId(supabase, userId); - // alert(JSON.stringify(data)); if (error) { console.error("Error while fetching projects"); } if (data) { + // set project and current project id setProjects(data); - // console.table(data); + setCurrentProjectId(data[0].id); } } else { console.error("Error with UserId while fetching projects"); @@ -108,8 +108,6 @@ export default function Dashboard() { }; fetchProjects(); }, [supabase, userId]); - // console.table(projects); - // console.table(latestInvestment); return (
@@ -135,95 +133,95 @@ export default function Dashboard() {

Business Dashboard

- - - + {projects && projects.length > 0 && ( + + + {projects.map((project) => ( + setCurrentProjectId(project.id)} + > + {project.project_name} + + ))} + {projects.map((project) => ( - setCurrentProjectId(project.id)} - > - {project.project_name} - - ))} - - {projects.map((project) => ( - -
- - - Total Funds Raised - - - - - -
${}
- {/*

+ +

+ + + Total Funds Raised + + + + + +
${}
+ {/*

+20.1% from last month

*/} -
-
- - - Profile Views - - - - - - -
+2350
- {/*

+ + + + + Profile Views + + + + + + +

+2350
+ {/*

+180.1% from last month

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

+ + + + + Total Followers + + + + + + + +

+12,234
+ {/*

+19% from last month

*/} -
-
- {/* + + + {/* Active Now @@ -248,59 +246,60 @@ export default function Dashboard() {

*/} -
-
- - - Overview - - - - {tabOptions.map((tab) => ( - - {tab.charAt(0).toUpperCase() + tab.slice(1)} - - ))} - - - +
+
+ + + Overview + + + + {tabOptions.map((tab) => ( + + {tab.charAt(0).toUpperCase() + tab.slice(1)} + + ))} + + + - - - setGraphType("line")}> - Line - - setGraphType("bar")}> - Bar - - - + + + setGraphType("line")}> + Line + + setGraphType("bar")}> + Bar + + + + + + + + + Recent Funds + + + { + return { + name: item.username, + amount: item.dealAmount, + avatar: item.avatarUrl, + date: new Date(item.createdTime), + status: item.dealStatus, + profile_url: `/profile/${item.investorId}`, + }; + })} + /> - - - - - Recent Funds - - - { - return { - name: item.username, - amount: item.dealAmount, - avatar: item.avatarUrl, - date: new Date(item.createdTime), - status: item.dealStatus, - profile_url: `/profile/${item.investorId}`, - }; - })} - /> - - -
- - ))} - +
+
+
+ ))} +
+ )}