Channel setup

Pro

Where 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.

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/channel-setup

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

Usage

TSX · The example above
"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>

PropTypeDefaultDescription
channelsrequiredChannel[]—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.
classNamestring | 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.

KeyEnglish
channelsChannels
emailEmail
notConnectedNot connected
whenAgentsPost{channel}: when agents post
repliesMentionsWhen asked
repliesMentionsDetailOnly replies when someone mentions it
repliesUpdatesUpdates
repliesUpdatesDetailAlso posts when runs finish or need someone
repliesOffOff
repliesOffDetailConnected but silent
connectConnect
reconnectReconnect