Away digest

Pro

What happened since you were last here, in the order you'd act on it: waiting on you, failed, finished. Empty groups are left out; nothing at all says so in one line.

Markdown

Preview

Install

With the Candor CLI

First time? Get started sets up the registry and theme. Or with shadcn directly: npx shadcn@latest add @candor/away-digest

Brings in: locale, ops, relative-time, utils · npm: lucide-react@^1.67.0

Usage

TSX · The example above
"use client"

import { AwayDigest } from "@/components/away-digest"
import type { DigestItem } from "@/lib/ops"

const ago = (m: number) => new Date(Date.now() - m * 60_000).toISOString()

const items: DigestItem[] = [
  { id: "g1", kind: "waiting", title: "Approve: Add region to customers", detail: "Production · 4 changes", at: ago(25) },
  { id: "g2", kind: "waiting", title: "Question from the Architect agent", detail: "Should the admin view show region too?", at: ago(14) },
  { id: "g3", kind: "failed", title: "Add region to customers: backfill stopped", detail: "Row lock on batch 12", at: ago(48) },
  { id: "g4", kind: "finished", title: "Weekly unused-flags report", detail: "6 flags fully rolled out for 30 days", at: ago(60 * 9) },
]

export default function Example() {
  return <AwayDigest className="max-w-lg" since={ago(60 * 16)} items={items} onOpen={() => {}} />
}

<AwayDigest>

PropTypeDefaultDescription
sincerequiredstring—When the person was last here (ISO date), shown as a relative time.
itemsrequiredDigestItem[]—What happened since, grouped by kind: waiting, failed, finished.
onOpen((id: string) => void) | undefined—Called with an item's id when a person opens it.
classNamestring | undefined—Extra classes for the outer element.

Strings

The fixed words, in English by default. Change any of them under awayDigest in <LocaleProvider strings={{ … }}>; the table is exported as awayDigestStrings.

KeyEnglish
whileAwayWhile you were away
sinceLastHereSince you were last here
things{ one: "{count} thing", other: "{count} things" }
nothingHappenedNothing happened while you were away.
group{label} · {count}
waitingWaiting on you
failedFailed
finishedFinished