Skip to content

Commit 67e0495

Browse files
Copilothotlong
andcommitted
Address code review feedback: improve type safety and remove redundant annotations
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent a6c4c52 commit 67e0495

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

apps/site/app/blog/[[...slug]]/page.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ function BlogListing() {
6161

6262
{post.data.tags && post.data.tags.length > 0 && (
6363
<div className="flex flex-wrap gap-2">
64-
{post.data.tags.map((tag: string) => (
64+
{post.data.tags.map((tag) => (
6565
<span
6666
key={tag}
6767
className="inline-flex items-center rounded-full bg-primary/10 px-3 py-1 text-xs font-medium text-primary"
@@ -86,7 +86,9 @@ function BlogListing() {
8686
}
8787

8888
// Blog post component
89-
function BlogPost({ page }: { page: any }) {
89+
function BlogPost({ page }: { page: ReturnType<typeof blogSource.getPage> }) {
90+
if (!page) return null;
91+
9092
const MDX = page.data.body;
9193

9294
return (
@@ -140,7 +142,7 @@ function BlogPost({ page }: { page: any }) {
140142

141143
{page.data.tags && page.data.tags.length > 0 && (
142144
<div className="flex flex-wrap gap-2 mt-4">
143-
{page.data.tags.map((tag: string) => (
145+
{page.data.tags.map((tag) => (
144146
<span
145147
key={tag}
146148
className="inline-flex items-center rounded-full bg-primary/10 px-3 py-1 text-xs font-medium text-primary"
@@ -233,4 +235,3 @@ export function generateMetadata({ params }: { params: { slug?: string[] } }): M
233235
description: page.data.description,
234236
};
235237
}
236-

0 commit comments

Comments
 (0)