Update examples and improve stability (#271)

This commit is contained in:
Jeremy 2024-03-19 01:35:03 +03:00 committed by GitHub
parent 25e4128e25
commit 70ed5c4f47
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 118 additions and 101 deletions

View file

@ -0,0 +1,30 @@
import { format, parseISO } from 'date-fns'
interface Event {
date: string
headline: string
description: string
}
export function Events({ props: events }: { props: Event[] }) {
return (
<div className="-mt-2 flex w-full flex-col gap-2 py-4">
{events.map(event => (
<div
key={event.date}
className="flex shrink-0 flex-col gap-1 rounded-lg bg-zinc-800 p-4"
>
<div className="text-sm text-zinc-400">
{format(parseISO(event.date), 'dd LLL, yyyy')}
</div>
<div className="text-base font-bold text-zinc-200">
{event.headline}
</div>
<div className="text-zinc-500">
{event.description.slice(0, 70)}...
</div>
</div>
))}
</div>
)
}