Skip to content

Commit

Permalink
chore: improve typing for author metadata socials
Browse files Browse the repository at this point in the history
  • Loading branch information
danny-avila committed Nov 16, 2024
1 parent ce4ad24 commit ad7a3b9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions components/Author/AuthorPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ interface AuthorMetadata {
name: string
bio: string
ogImage: string
socials?: Record<string, string>
socials?: {
[key: string]: string
}
}

const AuthorCard: React.FC<{ author: AuthorMetadata }> = ({ author }) => {
Expand All @@ -21,9 +23,7 @@ const AuthorCard: React.FC<{ author: AuthorMetadata }> = ({ author }) => {
setIsClient(true)
}, [])

const socialsEntries: [string, string][] = Object.entries(author.socials ?? {}).filter(
([, value]) => !!value,
)
const socialsEntries = Object.entries(author.socials ?? {}).filter(([, value]) => !!value)

return (
<Link href={`/authors/${author.authorid}`}>
Expand Down

0 comments on commit ad7a3b9

Please sign in to comment.