Add posts
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
tobias
2024-06-24 01:22:01 +02:00
parent 5eb7b7037b
commit d6fe6446a5
10 changed files with 234 additions and 112 deletions

View File

@ -0,0 +1,41 @@
import { Post } from 'types/payload-types'
import Image from 'next/image'
interface Props {
post: Post
}
export default function PostEntry(props: Props) {
if (typeof props.post.thumbnail === 'string') return
return (
<a className="py-4 border-secondary decoration-transparent" href={`/posts/${props.post.slug}`}>
<article className="flex px-5 py-3 gap-8">
<Image
src={props.post.thumbnail.url || ''}
width={150}
height={150}
alt={props.post.thumbnail.alt || ''}
layout="fixed"
/>
<div className="flex flex-col gap-4 w-full">
<div className="flex justify-between w-full">
<h3 className="">{props.post.title}</h3>
{props.post.publishedDate && (
<p className="font-light">
{new Date(props.post.publishedDate).toLocaleDateString('de-DE')}
</p>
)}
</div>
{props.post.summary && <p className="max-w-prose">{props.post.summary}</p>}
</div>
{/* {props.post.author.name && (
<p>
{props.post.author.name}
</p>
)} */}
</article>
</a>
)
}