Skip to content

Commit

Permalink
feat:create an Plan mıdel
Browse files Browse the repository at this point in the history
  • Loading branch information
ademsuslu committed Dec 2, 2024
1 parent c5f6570 commit cdf44ed
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
8 changes: 6 additions & 2 deletions app/(root)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<div className="flex flex-col space-y-6">
<div className="mt-6"></div>
Expand All @@ -23,7 +27,7 @@ export default function Home() {
<div className="mt-6"></div>
<Charts/>
<div className="mt-6"></div>
<Prices />
<Prices data={data} />
<div className="mt-6"></div>
<Products/>
<div className="mt-6"></div>
Expand Down
7 changes: 6 additions & 1 deletion components/shared/prices.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<Props> = ({data}) => {
return (
<div className='flex flex-col w-full'>
<div className='flex flex-col'>
Expand Down
11 changes: 11 additions & 0 deletions types/plans/model.ts
Original file line number Diff line number Diff line change
@@ -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;
};

0 comments on commit cdf44ed

Please sign in to comment.