import { Calendar, CalendarEvent } from '/lib/types.ts'; interface ViewEventModalProps { isOpen: boolean; calendarEvent: CalendarEvent; calendar: Pick; onClickDelete: (eventId: string) => void; onClose: () => void; } export default function ViewEventModal( { isOpen, calendarEvent, calendar, onClickDelete, onClose }: ViewEventModalProps, ) { if (!calendarEvent || !calendar) { return null; } const allDayEventDateFormat = new Intl.DateTimeFormat('en-GB', { year: 'numeric', month: 'long', day: 'numeric' }); const hourFormat = new Intl.DateTimeFormat('en-GB', { hour12: false, hour: '2-digit', minute: '2-digit' }); return ( <>

{calendarEvent.title}

{calendarEvent.start_date ? allDayEventDateFormat.format(new Date(calendarEvent.start_date)) : ''} {calendarEvent.is_all_day ? All-day : ( {calendarEvent.start_date ? hourFormat.format(new Date(calendarEvent.start_date)) : ''} -{' '} {calendarEvent.end_date ? hourFormat.format(new Date(calendarEvent.end_date)) : ''} )}
{calendar.name}

TODO: recurrence

{calendarEvent.extra.description ? (

{calendarEvent.extra.description}

) : null} {calendarEvent.extra.url ? (
{calendarEvent.extra.url}
) : null} {calendarEvent.extra.location ? (
{calendarEvent.extra.location}
) : null} {Array.isArray(calendarEvent.extra.attendees) && calendarEvent.extra.attendees.length > 0 ? (
{calendarEvent.extra.attendees.map((attendee) => (

{attendee.name || attendee.email} {' '} - {attendee.status}

))}
) : null}

TODO: reminders

); }