Create author component
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
tobias 2024-06-23 16:55:05 +02:00
parent b69d3ca9bc
commit f9ee909e01

33
src/components/Author.tsx Normal file
View File

@ -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<Props> = ({ author }) => {
return (
<>
{author && (
<div className="flex gap-6 border-t-2 border-secondary py-4 text-secondary">
{typeof author.avatar === 'object' && (
<Image
src={author.avatar.url || ''}
width={150}
height={150}
alt={author.avatar.alt || ''}
layout="fixed"
/>
)}
<div className="flex flex-col">
<h3 className="font-semibold text-base">{author.name}</h3>
<p className="text-sm font-light">{author.bio}</p>
</div>
</div>
)}
</>
)
}
export default AuthorComponent