fix: Wrap useSearchParams in Suspense boundary for board page
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import { useState, useEffect } from 'react';
|
import { useState, useEffect, Suspense } from 'react';
|
||||||
import { useRouter, useSearchParams } from 'next/navigation';
|
import { useRouter, useSearchParams } from 'next/navigation';
|
||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
import { boardApi, BoardPostListItem, BoardCategory, BoardPostListResponse, BoardCategoryListResponse } from '@/lib/api';
|
import { boardApi, BoardPostListItem, BoardCategory, BoardPostListResponse, BoardCategoryListResponse } from '@/lib/api';
|
||||||
@@ -8,7 +8,7 @@ import { useAuthStore } from '@/lib/store';
|
|||||||
import { useTranslate } from '@/lib/useTranslate';
|
import { useTranslate } from '@/lib/useTranslate';
|
||||||
import { useLanguageStore } from '@/lib/i18n';
|
import { useLanguageStore } from '@/lib/i18n';
|
||||||
|
|
||||||
export default function BoardPage() {
|
function BoardPageContent() {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const searchParams = useSearchParams();
|
const searchParams = useSearchParams();
|
||||||
const { user, token } = useAuthStore();
|
const { user, token } = useAuthStore();
|
||||||
@@ -294,3 +294,15 @@ export default function BoardPage() {
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default function BoardPage() {
|
||||||
|
return (
|
||||||
|
<Suspense fallback={
|
||||||
|
<div className="min-h-screen bg-gray-50 flex items-center justify-center">
|
||||||
|
<div className="inline-block animate-spin rounded-full h-8 w-8 border-4 border-blue-600 border-t-transparent"></div>
|
||||||
|
</div>
|
||||||
|
}>
|
||||||
|
<BoardPageContent />
|
||||||
|
</Suspense>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user