1
Fork 0
mirror of https://github.com/Steffo99/festa.git synced 2024-12-24 23:54:22 +00:00
festa/components/ListEvents.tsx

19 lines
422 B
TypeScript
Raw Normal View History

2022-06-01 16:54:59 +00:00
import { Event } from "@prisma/client"
2022-06-03 01:56:43 +00:00
import { default as Link } from "next/link"
2022-06-01 16:54:59 +00:00
2022-06-04 03:13:19 +00:00
type ListEventsProps = {
2022-06-01 16:54:59 +00:00
data: Event[]
}
2022-06-04 03:13:19 +00:00
export function ListEvents(props: ListEventsProps) {
2022-06-01 16:54:59 +00:00
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>
}