Skip to content

Open-source event management and ticket selling platform — perfect for concerts, conferences, and everything in between 🎟️ If you find this project helpful, please consider giving us a star ⭐️

1.0 KB
Raw Blame
import {t} from "@lingui/macro";
import {Card} from "../Card";
import {Event, EventOccurrence, LocationType} from "../../../types.ts";
import {resolveEventLocation} from "../../../utilites/effectiveLocation.ts";
import {UserGeneratedContent} from "../UserGeneratedContent";

interface OnlineEventDetailsProps {
    event?: Event | null;
    occurrence?: EventOccurrence | null;
}

export const OnlineEventDetails = (props: OnlineEventDetailsProps) => {
    if (!props.event) return null;
    const eventLocation = resolveEventLocation(props.event, props.occurrence ?? null);

    if (eventLocation?.type !== LocationType.Online || !eventLocation.online_event_connection_details) {
        return null;
    }
    const details = eventLocation.online_event_connection_details;

    return (
        <div style={{marginTop: "40px", marginBottom: "40px"}}>
            <h2>{t`Online Event Details`}</h2>
            <Card>
                <UserGeneratedContent html={details as string}/>
            </Card>
        </div>
    );
};