diff --git a/app/page.tsx b/app/page.tsx index 47f6156..79cb666 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -1,11 +1,15 @@ import Container from '@/components/Container'; import EmptyState from '@/components/EmptyState'; -import getListings from '@/actions/getListings'; +import getListings, { IListingParams } from '@/actions/getListings'; import ListingCard from '@/components/listings/ListingCard'; import getCurrentUser from '@/actions/getCurrentUser'; -export default async function Home() { - const listings = await getListings(); +interface HomeProps{ + searchParams:IListingParams +} + +const Home = async ({searchParams}:HomeProps) => { + const listings = await getListings(searchParams); const currentUser = await getCurrentUser(); if (listings.length === 0) { @@ -39,3 +43,4 @@ export default async function Home() { ); } +export default Home