diff --git a/src/app/find/ProjectSection.tsx b/src/app/find/ProjectSection.tsx
deleted file mode 100644
index 31ef700..0000000
--- a/src/app/find/ProjectSection.tsx
+++ /dev/null
@@ -1,57 +0,0 @@
-import React from "react";
-import { ProjectCard } from "@/components/projectCard";
-import { Separator } from "@/components/ui/separator";
-import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
-import { ProjectCardProps } from "@/types/ProjectCard";
-import Link from "next/link";
-
-export function ProjectSection({ projectsData }: { projectsData: ProjectCardProps[] | null }) {
- if (!projectsData || projectsData.length === 0) {
- return (
-
-
- No Project Found
-
-
- Sorry, we could not find any projects matching your search criteria.
-
-
- );
- }
-
- return (
-
diff --git a/src/components/ProjectSection.tsx b/src/components/ProjectSection.tsx
new file mode 100644
index 0000000..214a057
--- /dev/null
+++ b/src/components/ProjectSection.tsx
@@ -0,0 +1,44 @@
+import React from "react";
+import { ProjectCard } from "@/components/projectCard";
+import { Separator } from "@/components/ui/separator";
+import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
+import { ProjectCardProps } from "@/types/ProjectCard";
+import Link from "next/link";
+
+export function ProjectSection({ projectsData }: { projectsData: ProjectCardProps[] | null }) {
+ if (!projectsData || projectsData.length === 0) {
+ return (
+
+
+ No Project Found
+
+
+ Sorry, we could not find any projects.
+
+
+ );
+ }
+
+ return (
+
+ {projectsData.map((project) => (
+
+ ))}
+
+ );
+}
diff --git a/src/components/projectCard.tsx b/src/components/projectCard.tsx
index ff221f3..ded4889 100644
--- a/src/components/projectCard.tsx
+++ b/src/components/projectCard.tsx
@@ -3,6 +3,7 @@
import { CalendarDaysIcon } from "lucide-react";
import { cn } from "@/lib/utils";
import Image from "next/image";
+import { Separator } from "./ui/separator";
interface XMap {
[tag: string]: string;
@@ -13,7 +14,7 @@ interface ProjectCardProps {
description: string;
joinDate: string;
location: string;
- tags: XMap | null | never[] | string[];
+ tags?: XMap | null | never[] | string[];
imageUri: string | null;
minInvestment: number;
totalInvestor: number;
@@ -22,18 +23,6 @@ interface ProjectCardProps {
}
export function ProjectCard(props: ProjectCardProps) {
- if (props.minInvestment === null) {
- props.minInvestment = 0;
- }
-
- if (props.totalInvestor === null) {
- props.minInvestment = 0;
- }
-
- if (props.totalRaised === null) {
- props.minInvestment = 0;
- }
-
return (
{/* Info 2 (Visible on hover) */}
-
-
+
+
- ${props.totalRaised.toLocaleString()} committed and reserved
+
+ ${isNaN(props.totalRaised) || props.totalRaised == null ? "N/A" : props.totalRaised.toLocaleString()}
+ {" "}
+ committed and reserved
-
+
- {props.totalInvestor.toLocaleString()} investors
+
+ {isNaN(props.totalInvestor) || props.totalInvestor == null
+ ? "N/A "
+ : props.totalInvestor.toLocaleString()}
+ {" "}
+ investors
-
+
- ${props.minInvestment.toLocaleString()} min. investment
+
+ $
+ {isNaN(props.minInvestment) || props.minInvestment == null
+ ? "N/A"
+ : props.minInvestment.toLocaleString()}
+ {" "}
+ min. investment
diff --git a/src/types/ProjectCard.ts b/src/types/ProjectCard.ts
index 51e9955..ce70358 100644
--- a/src/types/ProjectCard.ts
+++ b/src/types/ProjectCard.ts
@@ -5,7 +5,7 @@ export interface ProjectCardProps {
image_url: string;
join_date: string;
location: string;
- tags: string[] | null;
+ tags?: string[] | null;
min_investment: number;
total_investor: number;
total_raise: number;