-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor:plans details so checkout okey
- Loading branch information
Showing
3 changed files
with
16 additions
and
13 deletions.
There are no files selected for viewing
17 changes: 9 additions & 8 deletions
17
app/(root)/checkout/[selectedPlan]/page.tsx → app/(root)/checkout/[id]/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,23 @@ | ||
import BillingDetay from "@/components/shared/billing/billing-detay"; | ||
import { BillingFormComponent } from "@/components/shared/forms/billing/billing-form"; | ||
|
||
import { plans } from "@/data/projects" | ||
|
||
export default async function BussinesDetails({ | ||
|
||
export default async function SelectedPlandDetails({ | ||
params, | ||
}: { | ||
params: Promise<{ selectedPlan: string }> | ||
params: Promise<{ id: string }> | ||
}) { | ||
const selectedPlan = (await params).selectedPlan | ||
const planData = plans.find(pland => pland.plan === selectedPlan) | ||
|
||
|
||
const id = (await params).id | ||
const response = await fetch(`${process.env.NEXT_API_URL}/plans/${id}`,{cache:"no-store"}) | ||
const data = await response.json() | ||
console.log("********************************") | ||
console.log(data) | ||
|
||
return <div className=" w-full gap-4 grid grid-cols-1 md:grid-cols-2 justify-between p-6"> | ||
<div className="border p-6 border-gray-300 shadow-lg rounded-lg bg-gray-900"> | ||
<BillingFormComponent /> | ||
</div> | ||
<BillingDetay planData={planData}/> | ||
<BillingDetay planData={data}/> | ||
</div> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters