# Event Preview

> A calendar event an agent wants to create or change: title, day and time in the provider's locale (timeZone optional, allDay), place, calendar, the guests with their answer (accepted, maybe, declined, no answer) and the events it overlaps.

Component · AI · Halo kit · [Live page](https://ui.twentyfirst.media/halo/components/EventPreview/)

A calendar event an agent wants to create or change: title, day and time in the provider's locale (`timeZone` optional, `allDay`), place, calendar, the guests with their answer (accepted, maybe, declined, no answer) and the events it overlaps.

## Example

```tsx
import { ApprovalCard, EventPreview } from "@twentyfirstmedia/halo";

export default function Preview() {
  return (
    <ApprovalCard
      agent="Assistant"
      project="Office"
      family="comms"
      age="4 min"
      title="Invite Lukas and Ida to the quarterly review"
      text="Both said Thursday morning works; invitations go out by mail."
    >
      <EventPreview
        title="Quarterly review"
        start="2026-04-16T10:00:00"
        end="2026-04-16T11:00:00"
        location="Room 2 · or video call"
        calendar="Team calendar"
        guests={[
          { name: "Mara Ellis", email: "mara@example.com", status: "accepted" },
          { name: "Lukas Brandt", email: "lukas@example.com", status: "open" },
          { name: "Ida Nolan", email: "ida@example.com", status: "tentative" },
        ]}
        conflicts={[
          { title: "Hiring sync", start: "2026-04-16T10:30:00", end: "2026-04-16T11:00:00" },
        ]}
        text="Numbers for Q1, the roadmap for Q2 and the hiring plan."
      />
    </ApprovalCard>
  );
}
```

## Props

### EventPreview

| Prop | Type | Notes |
| --- | --- | --- |
| `title` | `ReactNode` | Required |
| `start` | `Date \| string \| number` | Required |
| `end?` | `Date \| string \| number` |  |
| `allDay?` | `boolean` |  |
| `timeZone?` | `string` | IANA time zone for the times (default the browser's). |
| `location?` | `ReactNode` |  |
| `calendar?` | `ReactNode` |  |
| `guests?` | `EventPreviewGuest[]` |  |
| `conflicts?` | `{ title: string; start: Date \| string \| number; end?: Date \| string \| number }[]` | Events at the same time. |
| `text?` | `string` | The invitation or description text. |
| `warnings?` | `ReactNode[]` |  |
| `className?` | `string` | Extra class on the root element. |
| `style?` | `CSSProperties` | Inline style on the root element. |

### ApprovalCard

| Prop | Type | Notes |
| --- | --- | --- |
| `title` | `ReactNode` | Required |
| `text?` | `ReactNode` |  |
| `children?` | `ReactNode` |  |
| `agent?` | `string` |  |
| `project?` | `string` |  |
| `family?` | `RiskFamily` |  |
| `familyLabel?` | `string` |  |
| `age?` | `string` |  |
| `escalation?` | `ReactNode` |  |
| `trace?` | `ReactNode` |  |
| `note?` | `ReactNode` |  |
| `heading?` | `string` |  |
| `options?` | `ApprovalOption[]` |  |
| `approveLabel?` | `string` |  |
| `onDecide?` | `(key: ApprovalKey, text?: string) => void \| Promise<unknown>` | Called with the answer (and the text of B or D). Return a Promise to keep the card busy until it settles: the answer's button spins and every answer is disabled; a rejection shows an error (a rejected string is shown as is) and keeps the card open. Once it resolves, a card without a `decision` prop collapses to its one-line record; with a plain callback, set `decision` yourself. |
| `decision?` | `ApprovalDecision \| null` | The decision record: shown as one line instead of the card; `null` keeps the card open. |
| `compact?` | `boolean` | Side panels: tighter, the answers in a row, the payload folded behind "Show what runs" (one click, never a summary). |
| `stepUp?` | `boolean` | Money, legal and infrastructure decisions: A and B (the answers that run something) need a fresh passkey. They show "Needs your passkey"; while `onDecide` is pending the pressed answer says "Confirm with passkey". Do the WebAuthn step-up in `onDecide` and reject if it fails. |
| `busy?` | `ApprovalKey \| null` | The answer being sent, when you track it yourself (controlled busy state). |
| `error?` | `ReactNode` | An error to show above the answers (controlled); a rejected `onDecide` shows one by itself. |
| `screen?` | `boolean` | Fills its container, e.g. a deep link on a phone: the content scrolls and A–D stay at the bottom, full width, in thumb reach (with the safe area). |
| `href?` | `string` | Makes the title a link to the full approval (with `linkAs` for a router's link). |
| `linkAs?` | `ElementType` |  |
| `onApprove?` | `() => void` |  |
| `onDeny?` | `() => void` |  |
| `onEdit?` | `(text: string) => void` |  |
| `state?` | `"approved" \| "denied"` |  |
| `className?` | `string` | Extra class on the root element. |
| `style?` | `CSSProperties` | Inline style on the root element. |
