Skip to content

Commit e5ccc7c

Browse files
committed
fix: fix the build error
1 parent 69c4233 commit e5ccc7c

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

app/blogs/page.tsx

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,17 @@ async function getBlogs(page: number = 1): Promise<BlogResponse> {
6868
return data;
6969
}
7070

71-
export default async function BlogsPage({
72-
searchParams,
73-
}: {
74-
searchParams?: { [key: string]: string | undefined };
75-
}) {
71+
interface SearchParamsType {
72+
[key: string]: string | string[] | undefined;
73+
page?: string;
74+
}
75+
76+
interface PageProps {
77+
searchParams?: Promise<SearchParamsType>;
78+
}
79+
80+
export default async function BlogsPage(props: PageProps) {
81+
const searchParams = (await (props.searchParams || Promise.resolve<SearchParamsType>({ page: "1" })));
7682
const currentPage = Number(searchParams?.page) || 1;
7783
const data = await getBlogs(currentPage);
7884
const blogs = data?.data?.user?.posts?.edges || [];

0 commit comments

Comments
 (0)