diff --git a/src/app/(investment)/deals/[id]/page.tsx b/src/app/(investment)/deals/[id]/page.tsx index 0bb363d..15398c3 100644 --- a/src/app/(investment)/deals/[id]/page.tsx +++ b/src/app/(investment)/deals/[id]/page.tsx @@ -15,6 +15,7 @@ import FollowShareButtons from "./followShareButton"; import { getProjectData } from "@/lib/data/projectQuery"; import { getDealList } from "@/app/api/dealApi"; import { sumByKey, toPercentage } from "@/lib/utils"; +import { redirect } from "next/navigation"; export default async function ProjectDealPage({ params }: { params: { id: number } }) { const supabase = createSupabaseClient(); @@ -22,18 +23,25 @@ export default async function ProjectDealPage({ params }: { params: { id: number const { data: projectData, error: projectDataError } = await getProjectData(supabase, params.id); if (!projectData) { - return
Error fetching data. Please try again.
+ +- {toPercentage(totalDealAmount, projectData?.target_investment)}% - raised of ${projectData?.target_investment} max goal + {toPercentage(totalDealAmount, projectData?.target_investment)}% raised of $ + {projectData?.target_investment} max goal
- {projectData?.investment_deadline ? ( - <> -{Math.floor(hourLeft)} hours
-Left to invest
- > - ) : ( -No deadline
+ {projectData?.investment_deadline ? ( + <> +{Math.floor(hourLeft)} hours
+Left to invest
+ > + ) : ( +No deadline
)}