Skip to content

Commit

Permalink
updated search page.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
Guruprasad619 committed Oct 26, 2024
1 parent df056fa commit 89c43df
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/app/search/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"use client";
import { Suspense } from 'react';
import { useSearchParams } from 'next/navigation';
import ProductCard from '../components/ProductCard';

Expand Down Expand Up @@ -131,7 +132,7 @@ const productData = [
},
];

export default function SearchResults() {
function SearchResults() {
const searchParams = useSearchParams();
const query = searchParams.get('query');

Expand Down Expand Up @@ -161,3 +162,12 @@ export default function SearchResults() {
</div>
);
}

// This is the main page or parent component where you render SearchResults
export default function Page() {
return (
<Suspense fallback={<div>Loading...</div>}>
<SearchResults />
</Suspense>
);
}

0 comments on commit 89c43df

Please sign in to comment.