mirror of
https://github.com/Steffo99/festa.git
synced 2024-12-22 14:44:21 +00:00
18 lines
422 B
TypeScript
18 lines
422 B
TypeScript
import { Event } from "@prisma/client"
|
|
import { default as Link } from "next/link"
|
|
|
|
type ListEventsProps = {
|
|
data: Event[]
|
|
}
|
|
|
|
export function ListEvents(props: ListEventsProps) {
|
|
const contents = props.data.map(e => (
|
|
<li key={e.slug}>
|
|
<Link href={`/events/${e.slug}`}>
|
|
{e.name}
|
|
</Link>
|
|
</li>
|
|
))
|
|
|
|
return <ul className="list-events">{contents}</ul>
|
|
}
|