Skip to content

Commit f71d9fe

Browse files
Update apps/docs/app/(home)/blog/[slug]/page.tsx
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
1 parent 1a7eaa7 commit f71d9fe

File tree

1 file changed

+9
-5
lines changed
  • apps/docs/app/(home)/blog/[slug]

1 file changed

+9
-5
lines changed

apps/docs/app/(home)/blog/[slug]/page.tsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -179,11 +179,15 @@ export default async function PostPage({
179179
</Avatar>
180180
))}
181181
</div>
182-
<Link href={post.authors[0]?.socials[0]?.url ?? undefined} target='_blank' rel='noopener noreferrer'>
183-
<span>
184-
{post.authors[0].name}
185-
</span>
186-
</Link>
182+
{post.authors[0]?.socials?.[0]?.url ? (
183+
<Link href={post.authors[0].socials[0].url} target='_blank' rel='noopener noreferrer'>
184+
<span>
185+
{post.authors[0].name}
186+
</span>
187+
</Link>
188+
) : (
189+
<span>{post.authors[0].name}</span>
190+
)}
187191
{post.authors.length > 1 && (
188192
<span> +{post.authors.length - 1}</span>
189193
)}

0 commit comments

Comments
 (0)