import Markdown from 'markdown-to-jsx'
import dayjs from 'dayjs'
import classNames from 'classnames'
import { Modal } from '../../modal'
import Link from 'next/link.js'
function Card({ children, color }) {
let borderColor = 'bg-gray'
let bgColor = 'bg-white'
if (color) {
borderColor = 'bg-' + color
bgColor = 'bg-' + color
}
return (
<>
>
)
}
export function EventCard({ event, urlHash }) {
const isWorkInProgress = event.tags?.some((el) => el.toLowerCase() === "wip")
return (
} title={event.name} link={event.website} hash={event.hash} urlHash={urlHash}>
{event.name}
{event.isLive &&
}
{event.times !== "To be confirmed" &&
{event.times}
}
{event.venueName && event.venueName != "Private" &&
{event.venueName}
}
👤 {event.attendees && `${event.attendees} -`} {event.difficulty}
{event.org}
{event.tags?.map((tag, i) => (
(tag && {tag} )
))}
{event.logomark &&
}
)
}
function EventModalContent({ event, urlHash }) {
return (
<>
Date : {dateStr(event.date, event.days)}
Times : {event.times}
{event.venueName &&
Venue :
{event.venueName}
}
Track Lead : {event.dri}
Attendees : {event.attendees} ({event.difficulty})
{event.tags?.map((tag, i) => (
(tag && {tag} )
))}
{event.description && (
{event.description}
)}
{event.timeslots?.length >= 1 && }
>
)
}
export function AddCard({ config }) {
return (
// } title="Submit a track or talk" link="" hash="#add-event">
//
)
}
function AddEventModalContent({config}) {
return (
<>
The event listings in this website are coordinated through GitHub.
Steps to list your event:
Step 1 : Read & file a pull-request in this repo:
{config.repo}
Step 2 : Address any comments until your PR is merged.
Step 3 : Blastoff! ⭐️💙
>
)
}
function TimeslotTable({ timeslots, hash, urlHash }) {
const sortedTimeslots = timeslots.sort((a, b) => a.time.localeCompare(b.time))
return (
Schedule
TIME
SPEAKER
INFO
{sortedTimeslots?.map((timeslot, i) => {
const timeslotId = `${hash}-timeslot${i+1}`
const currentTimeslot = urlHash?.replace('/', '-timeslot')
const isCurrent = timeslotId === currentTimeslot
return (
{timeslot.time}
{timeslot.speakers}
{timeslot.title}
{timeslot.description && (
{timeslot.description}
)}
)
})}
)
}
function Tag({ children }) {
return (
{children}
)
}
function dateStr(date, days) {
const d1 = dayjs(date)
if (days === 1) {
return d1.format("MMM DD")
}
const d2 = d1.add(days - 1, 'day')
return d1.format("MMM DD") + ' - ' + d2.format("MMM DD")
}
export default EventCard