From f9ee909e01b65d92090f26dabf8e56f9619577ea Mon Sep 17 00:00:00 2001 From: tobias Date: Sun, 23 Jun 2024 16:55:05 +0200 Subject: [PATCH] Create author component --- src/components/Author.tsx | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 src/components/Author.tsx diff --git a/src/components/Author.tsx b/src/components/Author.tsx new file mode 100644 index 0000000..f575ea9 --- /dev/null +++ b/src/components/Author.tsx @@ -0,0 +1,33 @@ +import React from 'react' +import Image from 'next/image' +import type { Author } from 'types/payload-types' + +interface Props { + author: Author +} + +const AuthorComponent: React.FC = ({ author }) => { + return ( + <> + {author && ( +
+ {typeof author.avatar === 'object' && ( + {author.avatar.alt + )} +
+

{author.name}

+

{author.bio}

+
+
+ )} + + ) +} + +export default AuthorComponent