channel / components / channel-timeline
ChannelTimeline
Preview
Hola! Necesito cotizar 200 cascos certificados.
Tomo el pedido: 200 cascos IRAM 3620. ¿Fecha límite?
Subject: RFQ — 200 cascos certificados Solicitamos cotización por 200 unidades.
Cotizamos USD 11.40/u, entrega 10 días hábiles.
Aprobado 👍 generá la OC.
Install
pnpm dlx shadcn@latest add https://registry.ekairos.dev/r/channel-timeline.jsonStart simple: a list of messages
Give it an array of canonical messages and it renders the conversation with day separators. No backend, no config — useful for demos, tests and server snapshots:
import { ChannelTimeline } from "@/components/ekairos/channel/channel-timeline";
<ChannelTimeline messages={messages} />Then: filter by channel
Pass channels to focus the view — here, toggling platforms live:
Subject: RFQ — 200 cascos certificados Solicitamos cotización por 200 unidades.
Cotizamos USD 11.40/u, entrega 10 días hábiles.
Finally: make it live
This is the real mode. Hand it your InstantDB react client and a context id and the timeline becomes a reactive query over channel_messages — a whatsapp reply appears the moment the webhook persists it. The demo on this site runs exactly this against your temporary database:
"use client";
import { db } from "@/lib/db.client"; // InstantDB react client
<ChannelTimeline db={db} contextId={thread.contextId} />db from the first render (a stable client instance) — the component decides its data source at mount.Props
| prop | type | description |
|---|---|---|
| db | InstantDB react client | Live mode: reactive query over channel_messages. Takes precedence over messages. |
| contextId | string | null | Agent context to read the conversation from (live mode). |
| messages | ChannelMessage[] | Static rows for demos, tests and snapshots. |
| channels | string[] | Restrict to specific channels. Default: all. |
| emptyState | ReactNode | Rendered when there are no visible messages. |
| className | string | Container class. |