diff --git a/src/app/page.tsx b/src/app/page.tsx index 78f00bf..19cc657 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,13 +1,7 @@ import Image from "next/image"; import { Button } from "@/components/ui/button"; import Link from "next/link"; -import { - Card, - CardContent, - CardDescription, - CardHeader, - CardTitle, -} from "@/components/ui/card"; +import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"; import { Separator } from "@/components/ui/separator"; import { ProjectCard } from "@/components/projectCard"; import { getTopProjects } from "@/lib/data/projectQuery"; @@ -47,17 +41,12 @@ const TopProjects: FC = ({ projects }) => { imageUri={project.card_image_url} joinDate={new Date(project.published_time).toLocaleDateString()} location={project.business[0]?.location || ""} - tags={project.project_tag.flatMap( - (item: { tag: { id: number; value: string }[] }) => - Array.isArray(item.tag) ? item.tag.map((tag) => tag.value) : [] + tags={project.project_tag.flatMap((item: { tag: { id: number; value: string }[] }) => + Array.isArray(item.tag) ? item.tag.map((tag) => tag.value) : [] )} - minInvestment={ - project.project_investment_detail[0]?.min_investment || 0 - } + minInvestment={project.project_investment_detail[0]?.min_investment || 0} totalInvestor={0} - totalRaised={ - project.project_investment_detail[0]?.total_investment || 0 - } + totalRaised={project.project_investment_detail[0]?.total_investment || 0} /> ))} @@ -68,17 +57,13 @@ const TopProjects: FC = ({ projects }) => { const ProjectsLoader = () => (
{[...Array(4)].map((_, index) => ( -
+
))}
); export default async function Home() { const supabase = createSupabaseClient(); - const { data: topProjectsData, error: topProjectsError } = - await getTopProjects(supabase); + const { data: topProjectsData, error: topProjectsError } = await getTopProjects(supabase); return (
@@ -87,14 +72,9 @@ export default async function Home() {
-

- Explore the world of ventures -

+

Explore the world of ventures

-

- Unlock opportunities and connect with a community of - passionate -

+

Unlock opportunities and connect with a community of passionate

investors and innovators.

Together, we turn ideas into impact.

@@ -142,23 +122,11 @@ export default async function Home() { @@ -170,13 +138,15 @@ export default async function Home() {

Hottest Deals

-

- The deals attracting the most interest right now -

+

The deals attracting the most interest right now

- }> - - + {topProjectsError ? ( +
Error fetching projects: {topProjectsError}
+ ) : ( + }> + + + )}