--- import type { Event } from '../../lib/db'; import { fmtDateTime } from '../../lib/markdown'; interface Props { events: Event[]; editing: Event | null; viewing: Event | null; viewingRsvps: { going: number; interested: number; declined: number } | null; } const { events, editing, viewing, viewingRsvps } = Astro.props; const KIND_LABEL = { dinner: 'Dinner', office_hours: 'Office hours', summit: 'Summit', virtual: 'Virtual', } as const; function toInputValue(sql: string | null | undefined): string { if (!sql) return ''; return sql.replace(' ', 'T').slice(0, 16); } const formAction = editing ? 'update_event' : 'create_event'; ---
{fmtDateTime(viewing.starts_at)} ยท {viewing.location}
No events yet.
) : (| Title | Kind | When | Location | Actions |
|---|---|---|---|---|
| {ev.title} | {KIND_LABEL[ev.kind]} | {fmtDateTime(ev.starts_at)} | {ev.location || 'โ'} | RSVPs Edit |