# Operations bento

> Four color image placeholder tiles for queues, on-call, the current incident and availability, with an incident log and history.

- Kind: block · Category: Bento · Interactivity: native
- Install: `npx shadcn@latest add @haze/bento-operations`
- File: `src/components/haze/blocks/bento-operations.astro`
- npm dependencies: none
- Registry dependencies: @haze/bento-tile, @haze/collapsible, @haze/section-heading, @haze/timeline, @haze/utils
- Docs page: https://hazeui.com/blocks/bento-operations

## Use when
- An operations page shows the current incident and who is on call.
- The next operator needs the incident status and availability in one view.

## Avoid when
- People need to page an engineer or resolve incidents from the panel.

## Alternatives
- [bento-trust-analytics](https://hazeui.com/blocks/bento-trust-analytics.md)
- [timeline](https://hazeui.com/ui/timeline.md)
- [uptime-tracker](https://hazeui.com/ui/uptime-tracker.md)

## Props

| Name | Type | Default | Required | Description |
|---|---|---|---|---|
| id | `string` | bento-operations | no | Unique section ID prefix. Set it for each instance. |
| title | `string` |  | no | Visible section heading. |
| description | `string` |  | no | Short description of the handoff context. |
| headingLevel | `1 \| 2 \| 3` | 2 | no | Heading level for the section. |
| incident | `Incident` |  | no | Incident title and status text. |
| updates | `TimelineItem[]` |  | no | Chronological updates with titles, optional date text and descriptions. |
| onCall | `OnCall \| null` |  | no | Engineer name and shift detail. Pass null to hide. |
| uptime | `UptimePeriod[]` |  | no | Labeled service periods with availability state. |
| class | `string` |  | no | Classes on the section. |

## Accessibility
- Each color field stands in for a product image and is aria-hidden.
- The incident log and availability history can be read as text in their disclosures.
- Key Enter / Space: Expand or collapse the incident log or availability history.

## Agent prompts

### Install and use

Install the Haze UI block "Operations bento" with `npx shadcn@latest add @haze/bento-operations`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import BentoOperations from "@/components/haze/blocks/bento-operations.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/bento-operations.md

### Customize with real content

Adapt the Haze bento-operations block for our product. Replace the demo values of these props with our real content: id, title, description, headingLevel, incident, updates, onCall, uptime, class. Keep the layout, the heading level rules and these accessibility details: Each color field stands in for a product image and is aria-hidden. The incident log and availability history can be read as text in their disclosures. Do not add raw color classes; use the Haze tokens.

### Choose the right block

Before using bento-operations, check it fits: use it when an operations page shows the current incident and who is on call.; the next operator needs the incident status and availability in one view.. Avoid it when people need to page an engineer or resolve incidents from the panel.. Alternatives: @haze/bento-trust-analytics, @haze/timeline, @haze/uptime-tracker.

## Example requests that should lead here
- Build an on-call handoff section with an incident log, weekly availability and image tiles.

## Source

```astro
---
import { cn } from "../../../lib/haze/utils";
import BentoTile from "../ui/bento-tile.astro";
import Collapsible from "../ui/collapsible.astro";
import SectionHeading from "../ui/section-heading.astro";
import Timeline from "../ui/timeline.astro";

interface Props {
  id?: string;
  title?: string;
  description?: string;
  headingLevel?: 1 | 2 | 3;
  incident?: { title: string; status: string };
  updates?: { title: string; date?: string; datetime?: string; description?: string; current?: boolean }[];
  onCall?: { name: string; detail: string } | null;
  uptime?: { label: string; status: "operational" | "degraded" | "outage" | "no-data" }[];
  class?: string;
}

const {
  id = "bento-operations", title = "Keep deliveries moving", headingLevel = 2,
  description = "Watch queues, incidents and uptime in one place, and know who is carrying the pager.",
  incident = { title: "Webhook delivery delays", status: "Monitoring" },
  updates = [
    { title: "Delay detected", date: "09:02 UTC", description: "Retry jobs began waiting longer than 30 seconds." },
    { title: "Workers scaled up", date: "09:14 UTC", description: "Extra workers are processing the backlog." },
    { title: "Delivery recovered", date: "09:27 UTC", description: "The team is watching delivery times before closing the incident." },
  ],
  onCall = { name: "Amina Park", detail: "On call until 16:00 UTC" },
  uptime = [
    { label: "Mon", status: "operational" }, { label: "Tue", status: "operational" },
    { label: "Wed", status: "degraded" }, { label: "Thu", status: "operational" },
    { label: "Fri", status: "operational" }, { label: "Sat", status: "operational" },
    { label: "Sun", status: "operational" },
  ],
  class: className,
} = Astro.props;
const tileHeading = ({ 1: 2, 2: 3, 3: 4 } as const)[headingLevel];
const statusLabel = { operational: "Operational", degraded: "Degraded", outage: "Outage", "no-data": "No data" };
const operational = uptime.filter(period => period.status === "operational").length;
---

<section aria-labelledby={`${id}-title`} class={cn("bg-background px-4 py-14 sm:px-8 sm:py-20", className)}>
  <div class="mx-auto grid max-w-6xl gap-8 sm:gap-10">
    <header class="grid items-end gap-3 md:grid-cols-[1.3fr_1fr] md:gap-12">
      <SectionHeading id={`${id}-title`} title={title} headingLevel={headingLevel}
        class="[&_:is(h1,h2,h3)]:max-w-[15ch] sm:[&_:is(h1,h2,h3)]:text-5xl/13" />
      {description && <p class="max-w-lg text-pretty text-base/7 text-muted-foreground">{description}</p>}
    </header>
    <div data-bento-grid class="grid min-w-0 gap-3 md:grid-cols-12 md:gap-4">
      <BentoTile title="Queue capacity" description="Jobs in the current dispatch window." headingLevel={tileHeading}
        class={onCall ? "md:col-span-7" : "md:col-span-12"} visualClass="flex-1">
        <div slot="visual" aria-hidden="true" class="min-h-44 sm:min-h-56"></div>
      </BentoTile>
      {onCall && (
        <BentoTile title="On-call handoff" description={`${onCall.name} · ${onCall.detail}`} headingLevel={tileHeading} class="md:col-span-5" visualClass="flex-1 bg-foreground/6">
          <div slot="visual" aria-hidden="true" class="min-h-44 sm:min-h-56"></div>
        </BentoTile>
      )}
      <BentoTile title={incident.title} description={incident.status} headingLevel={tileHeading} class="md:col-span-5" visualClass="flex-1 bg-foreground/6">
        <div slot="visual" aria-hidden="true" class="min-h-44 sm:min-h-56"></div>
        {updates.length > 0 && <Collapsible title="Incident log"><Timeline items={updates} /></Collapsible>}
      </BentoTile>
      <BentoTile title="Service availability" description={`${operational} of ${uptime.length} days operational`} headingLevel={tileHeading} class="md:col-span-7" visualClass="flex-1 bg-foreground/6">
        <div slot="visual" aria-hidden="true" class="min-h-44 sm:min-h-56"></div>
        {uptime.length > 0 && <Collapsible title="View history">
          <dl class="grid gap-1.5">{uptime.map(period => (
            <div class="flex flex-wrap justify-between gap-x-2"><dt class="wrap-anywhere">{period.label}</dt><dd class="text-foreground">{statusLabel[period.status]}</dd></div>
          ))}</dl>
        </Collapsible>}
      </BentoTile>
    </div>
  </div>
</section>
```
