Skip to content

Commit 3190366

Browse files
committed
simplify Blog template props using spread syntax
1 parent 90f3049 commit 3190366

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

src/app/blog/[[...slug]]/page.tsx

+2-14
Original file line numberDiff line numberDiff line change
@@ -67,24 +67,12 @@ export default async function BlogPage({ params }: Props) {
6767
return <Post post={data.post} />;
6868
}
6969

70-
const { posts, totalPage, pageNumber, paginationPath, type, filterValue } =
71-
data;
70+
const { type, filterValue } = data;
7271

7372
const metadata = getPageMetadata({ type, filterValue });
7473
if (metadata == null) {
7574
notFound();
7675
}
7776

78-
const { title, description } = metadata;
79-
80-
return (
81-
<Blog
82-
title={title}
83-
description={description}
84-
posts={posts}
85-
pageNumber={pageNumber}
86-
totalPage={totalPage}
87-
paginationPath={paginationPath}
88-
/>
89-
);
77+
return <Blog {...metadata} {...data} />;
9078
}

0 commit comments

Comments
 (0)