Skip to content

Commit 02af832

Browse files
fix(compare): wrap CompareClient in Suspense boundary to fix Next.js build error with useSearchParams
1 parent 5b34d80 commit 02af832

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

app/compare/page.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { Suspense } from 'react';
12
import type { Metadata } from 'next';
23
import CompareClient from './CompareClient';
34

@@ -12,5 +13,15 @@ export const metadata: Metadata = {
1213
};
1314

1415
export default function ComparePage() {
15-
return <CompareClient />;
16+
return (
17+
<Suspense
18+
fallback={
19+
<div className="min-h-screen flex items-center justify-center pt-28 pb-16">
20+
<div className="w-8 h-8 rounded-full border-2 border-emerald-500 border-t-transparent animate-spin"></div>
21+
</div>
22+
}
23+
>
24+
<CompareClient />
25+
</Suspense>
26+
);
1627
}

0 commit comments

Comments
 (0)