@@ -7,12 +7,12 @@ import { AnimatedContainer, AnimatedElement, AnimatedSection } from "@/component
77import { notFound } from "next/navigation" ;
88
99interface AuthorPageProps {
10- params : { slug : string } ;
11- searchParams ?: { page ?: string } ;
10+ params : Promise < { slug : string } > ;
11+ searchParams : Promise < { page ?: string } > ;
1212}
1313
14- export async function generateMetadata ( { params } : { params : { slug : string } } ) {
15- const { slug } = params ;
14+ export async function generateMetadata ( { params } : { params : Promise < { slug : string } > } ) {
15+ const { slug } = await params ;
1616 const author = await getAuthorBySlug ( slug ) ;
1717
1818 if ( ! author ) {
@@ -48,7 +48,8 @@ export async function generateMetadata({ params }: { params: { slug: string } })
4848}
4949
5050export default async function AuthorPage ( { params, searchParams } : AuthorPageProps ) {
51- const { slug } = params ;
51+ const { slug } = await params ;
52+ const { page } = await searchParams ;
5253
5354 if ( ! slug ) notFound ( ) ;
5455
@@ -57,7 +58,7 @@ export default async function AuthorPage({ params, searchParams }: AuthorPagePro
5758
5859 const posts = await getBlogPostsByAuthor ( slug ) ;
5960 const ITEMS_PER_PAGE = 6 ;
60- const currentPage = Math . max ( 1 , parseInt ( searchParams ?. page || "1" , 10 ) ) ;
61+ const currentPage = Math . max ( 1 , parseInt ( page || "1" , 10 ) ) ;
6162 const totalPages = Math . ceil ( posts . length / ITEMS_PER_PAGE ) ;
6263 const paginatedPosts = posts . slice (
6364 ( currentPage - 1 ) * ITEMS_PER_PAGE ,
0 commit comments