import type { Listing } from "@ace/host/protocol"; import { Conversation } from "./conversation"; import { host } from "./host"; import { CHAT, Layout } from "./layout/layout"; import { Diff } from "./panels/diff"; import { Terminal } from "./panels/terminal"; // Channels have one chat today; its tabs follow the chat the Chat tab shows. const chat = 1; type Props = { channel: Listing; user: string; remote: boolean }; /** A channel's tabs: its chat, plus Diff and Terminal views of that chat's lane. */ export function Channel({ channel, user, remote }: Props) { return ( { if (uid === CHAT) return ; if (data.type === "diff") { return ; } if (data.type !== "terminal") return null; return ( update({ terminal })} /> ); }} onTabClose={(_, data) => { if (data.type !== "terminal" || !data.terminal) return; host.request({ op: "terminal-close", terminal: data.terminal }).catch(() => {}); }} /> ); }