Channel setup
ProWhere agents can reach the team outside the app, one row per channel: its status, where it posts, and when an agent may post without asking. A broken channel says what's wrong and offers to reconnect.
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/channel-setup
Brings in: button, locale, ops, utils · npm: lucide-react@^1.67.0
Usage
"use client"
import * as React from "react"
import { ChannelSetup } from "@/components/channel-setup"
import type { Channel } from "@/lib/ops"
export default function Example() {
const [channels, setChannels] = React.useState<Channel[]>([
{ id: "slack", kind: "slack", status: "connected", target: "#eng-keel", replies: "updates" },
{ id: "teams", kind: "teams", status: "not-connected", replies: "off" },
{ id: "email", kind: "email", status: "broken", replies: "mentions", problem: "Bounced: platform@acme.example doesn’t accept outside mail" },
])
return (
<ChannelSetup
className="max-w-xl"
channels={channels}
onConnect={() => {}}
onReplies={(id, replies) => setChannels((cs) => cs.map((c) => (c.id === id ? { ...c, replies } : c)))}
/>
)
}<ChannelSetup>
| Prop | Type | Default | Description |
|---|---|---|---|
| channelsrequired | Channel[] | — | One row per channel, with its status, where it posts and when agents may post. |
| onConnect | ((id: string) => void) | undefined | — | Shows Connect, or Reconnect on a broken channel; called with the channel id. |
| onReplies | ((id: string, r: Channel["replies"]) => void) | undefined | — | Shows the when-agents-post choice on connected channels; called with the channel id and the new setting. |
| className | string | undefined | — | Extra classes for the outer element. |
Strings
The fixed words, in English by default. Change any of them under channelSetup in <LocaleProvider strings={{ … }}>; the table is exported as channelSetupStrings.
| Key | English |
|---|---|
| channels | Channels |
| notConnected | Not connected |
| whenAgentsPost | {channel}: when agents post |
| repliesMentions | When asked |
| repliesMentionsDetail | Only replies when someone mentions it |
| repliesUpdates | Updates |
| repliesUpdatesDetail | Also posts when runs finish or need someone |
| repliesOff | Off |
| repliesOffDetail | Connected but silent |
| connect | Connect |
| reconnect | Reconnect |