import type { Event } from "@mosaic/shared"; import { formatTime, formatDate } from "@/lib/utils/date-format"; import Link from "next/link"; interface UpcomingEventsWidgetProps { events: Event[]; isLoading: boolean; } export function UpcomingEventsWidget({ events, isLoading }: UpcomingEventsWidgetProps) { if (isLoading) { return (
Loading events...
); } const upcomingEvents = events.slice(0, 4); return (

Upcoming Events

View calendar →
{upcomingEvents.length === 0 ? (

No upcoming events

) : (
{upcomingEvents.map((event) => (
{formatDate(event.startTime).split(',')[0]}
{formatTime(event.startTime)}

{event.title}

{event.location && (

📍 {event.location}

)}
))}
)}
); }