import React, { ReactNode } from "react"; // import { Button } from "./Button"; import { Image } from "./Image"; import { EventSetting } from "./EventSetting"; import styles from "./EventDescriptionCard.module.css"; interface Props { name: string; online: boolean; location: string; date: Date; poster?: string; registerLink?: string; children: ReactNode; } function getPlatformURL(platform: string) { switch (platform) { case "Twitch": return "https://www.twitch.tv/uwcsclub"; case "Discord": return "https://discord.gg/pHfYBCg"; case "Facebook": return "https://www.facebook.com/uw.computerscienceclub"; case "Instagram": return "https://www.instagram.com/uwcsclub/"; default: return; } } /** * @remarks * - Child elements will display as the event's description * - Assuming date prop is in EST * - poster is the event's image name, including file ending (.jpg/.png/etc) * - If event is online, location will be the platform, with capital first letter and no trailing spaces * - ie. location="Discord" * @todo * get Link component */ export function EventDescriptionCard({ location, poster, name, date, online, registerLink, children, }: Props) { const platformURL = getPlatformURL(location); return (
{poster && {name}}

{name}

{children}
); }