46 lines
999 B
TypeScript
46 lines
999 B
TypeScript
|
import React, { ReactNode } from "react";
|
||
|
import styles from "./EventCard.module.css";
|
||
|
|
||
|
import { EventSetting } from "./EventSetting";
|
||
|
import { Image } from "./Image";
|
||
|
|
||
|
interface EventCardProps {
|
||
|
name: string;
|
||
|
short: string;
|
||
|
date: Date;
|
||
|
online: boolean;
|
||
|
location: string;
|
||
|
poster: string;
|
||
|
registerLink: string;
|
||
|
children: ReactNode;
|
||
|
}
|
||
|
|
||
|
export function EventCard({
|
||
|
name,
|
||
|
date,
|
||
|
online,
|
||
|
location,
|
||
|
poster,
|
||
|
registerLink,
|
||
|
children,
|
||
|
}: EventCardProps) {
|
||
|
return (
|
||
|
<article className={styles.card}>
|
||
|
<aside>
|
||
|
<Image alt={name} src={poster} />
|
||
|
{/* TODO: use the <Button /> component */}
|
||
|
<button className={styles.registerButton}>
|
||
|
<a href={registerLink}>Register</a>
|
||
|
</button>
|
||
|
</aside>
|
||
|
<section className={styles.content}>
|
||
|
<h2>{name}</h2>
|
||
|
<h3>
|
||
|
<EventSetting date={date} online={online} location={location} />
|
||
|
</h3>
|
||
|
<div>{children}</div>
|
||
|
</section>
|
||
|
</article>
|
||
|
);
|
||
|
}
|