diff --git a/app/(root)/page.tsx b/app/(root)/page.tsx index c8bf30d..a718e7d 100644 --- a/app/(root)/page.tsx +++ b/app/(root)/page.tsx @@ -9,7 +9,11 @@ import Solitions from "@/components/shared/solitions" import Suponsores from "@/components/shared/sponsores" import Whatscrm from "@/components/shared/whatscrm" -export default function Home() { +export default async function Home() { +// create a fetch for get + const response = await fetch(`${process.env.NEXT_API_URL}/plans`,{cache:"no-store"}) + const data = await response.json() + // render the home page with fetched data return (
@@ -23,7 +27,7 @@ export default function Home() {
- +
diff --git a/components/shared/prices.tsx b/components/shared/prices.tsx index 63314c0..987ecb6 100644 --- a/components/shared/prices.tsx +++ b/components/shared/prices.tsx @@ -3,7 +3,12 @@ import React from 'react' import { TiTick } from "react-icons/ti"; import { Button } from '../ui/button'; -const Prices = () => { +import {Plans } from "@/types/plans/model" + +interface Props { + data:Plans[] +} +const Prices:React.FC = ({data}) => { return (
diff --git a/types/plans/model.ts b/types/plans/model.ts new file mode 100644 index 0000000..f7e1fca --- /dev/null +++ b/types/plans/model.ts @@ -0,0 +1,11 @@ + +export type Plans = { + _id: string; + plan: string; + price: number; + features: string[]; // Features alanı string array olarak güncellendi. + createdAt: string; + updatedAt: string; + __v: number; +}; +