diff --git a/src/layouts/bots/(partials)/rail-workspace-list.tsx b/src/layouts/bots/(partials)/rail-workspace-list.tsx index bfa571c..87b2bb8 100644 --- a/src/layouts/bots/(partials)/rail-workspace-list.tsx +++ b/src/layouts/bots/(partials)/rail-workspace-list.tsx @@ -2,7 +2,10 @@ import Divider from "@moduletrace/twui/layout/Divider"; import { useContext } from "react"; import { AddFlowContext } from "../(data)/add-flow-context"; import type { BotWithLastMessage, WorkspaceWithActivity } from "@/src/types"; +import CoordinatorRow from "./coordinator-row"; import RailBackLink from "./rail-back-link"; +import RailBotCard from "./rail-bot-card"; +import RailBotSessions from "./rail-bot-sessions"; import RailBotsSection from "./rail-bots-section"; import RailSectionAddButton from "./rail-section-add-button"; import WorkspaceRow from "./workspace-row"; @@ -10,8 +13,8 @@ import WorkspaceRow from "./workspace-row"; type Props = { workspace: WorkspaceWithActivity; /** - * The workspace's crew: the coordinator is left out, only the bots - * attached to the workspace show. + * The workspace's crew: the bots attached to the workspace, plus (for + * the super admin, who works in every workspace) the coordinator. */ bots: BotWithLastMessage[]; selected_id?: number; @@ -23,11 +26,12 @@ type Props = { /** * The rail inside a workspace: back to all bots, the workspace itself (its - * page), then the workspace's bots. Every conversation here runs with the - * workspace's context. The coordinator is reached from the main rail. + * page), the coordinator working in it, then the workspace's bots. Every + * conversation here runs with the workspace's context. */ export default function RailWorkspaceList({ workspace, bots, selected_id, on_workspace_page }: Props) { const { openLinkBots } = useContext(AddFlowContext); + const coordinator = bots.find((bot) => bot.kind === "coordinator"); const workers = bots.filter((bot) => bot.kind !== "coordinator"); const base = `/admin/workspaces/${workspace.id}`; @@ -39,6 +43,23 @@ export default function RailWorkspaceList({ workspace, bots, selected_id, on_wor /> + {coordinator ? ( + + + {coordinator.id === selected_id ? ( + + ) : null} + + ) : null} } title="Workspace bots"