{/* Event summary */}
{derive(
pendingOp,
(op: PendingOperation) => op?.event.summary || "Untitled",
)}
{/* Time */}
🕐
{derive(pendingOp, (op: PendingOperation) =>
op?.event.start
? `${formatDateTime(op.event.start)} - ${
formatDateTime(op.event.end)
}`
: "")}
{/* Location */}
{ifElse(
derive(
pendingOp,
(op: PendingOperation) =>
!!op?.event.location,
),
📍
{derive(pendingOp, (op: PendingOperation) =>
op?.event.location)}
,
null,
)}
{/* Attendees */}
{ifElse(
derive(
pendingOp,
(op: PendingOperation) =>
op?.event.attendees && op.event.attendees.length > 0,
),
👥
Attendees (
{derive(
pendingOp,
(op: PendingOperation) =>
op?.event.attendees?.length || 0,
)}
)
{derive(pendingOp, (op: PendingOperation) =>
(op?.event.attendees || []).map((email) => (
{email}
)))}
,
null,
)}
{/* RSVP status indicator */}
{ifElse(
derive(
pendingOp,
(op: PendingOperation) =>
op?.operation === "rsvp" && !!op?.rsvpStatus,
),
{
switch (op?.rsvpStatus) {
case "accepted":
return "#d1fae5";
case "declined":
return "#fee2e2";
case "tentative":
return "#fef3c7";
default:
return "#f3f4f6";
}
},
),
}}
>
Your response:{" "}
{derive(
pendingOp,
(op: PendingOperation) =>
op?.rsvpStatus,
)}
,
null,
)}
op?.operation === "delete"
? "1px solid #ef4444"
: "1px solid #f59e0b",
),
background: derive(
pendingOp,
(op: PendingOperation) =>
op?.operation === "delete" ? "#fee2e2" : "#fef3c7",
),
}}
>
op?.operation === "delete" ? "#991b1b" : "#92400e",
),
}}
>
{derive(
pendingOp,
(op: PendingOperation) =>
getOperationWarning(op).title,
)}
op?.operation === "delete" ? "#b91c1c" : "#78350f",
),
}}
>
{derive(
pendingOp,
(op: PendingOperation) =>
getOperationWarning(op).desc,
)}