Skip to content

Commit

Permalink
fetch customers data and render the customers table
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnMwendwa committed Nov 30, 2023
1 parent 8fa53c8 commit 26df0f6
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions app/dashboard/customers/page.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
import { Metadata } from "next"
import { Suspense } from "react";

import { fetchFilteredCustomers } from "@/app/lib/data";
import CustomersTable from "@/app/ui/customers/table";

export const metadata:Metadata={
title:"Customers"
}

export default function CustomersPage() {
export default async function CustomersPage({searchParams}:{searchParams:{
query?:string;
page?:string;
}}) {
const query = searchParams?.query || "";
const customers = await fetchFilteredCustomers(query);
return (
<div>Customers Page</div>
<Suspense >
<CustomersTable customers={customers} />
</Suspense>
)
}

0 comments on commit 26df0f6

Please sign in to comment.