export type ConnectionState = "CONNECTED" | "DEGRADED" | "RECONNECTING"; export interface OperationTab { id: string; project: string; session: string; title: string; running?: boolean; } export interface TeamserverWorkspace { id: string; name: string; shortName: string; connection: ConnectionState; unread: number; activeProject: string; activeTabId: string; tabs: OperationTab[]; } export const initialWorkspaces: TeamserverWorkspace[] = [ { id: "atlas", name: "Atlas Teamserver", shortName: "AT", connection: "CONNECTED", unread: 2, activeProject: "Northwind", activeTabId: "nw-sessions", tabs: [ { id: "nw-sessions", project: "Northwind", session: "All sessions", title: "Sessions" }, { id: "nw-042", project: "Northwind", session: "NW-042", title: "Session Overview" }, { id: "or-audit", project: "Orchid", session: "Project", title: "Audit", running: true }, ], }, { id: "ember", name: "Ember Lab", shortName: "EL", connection: "DEGRADED", unread: 5, activeProject: "Sandbox", activeTabId: "sb-events", tabs: [ { id: "sb-events", project: "Sandbox", session: "Project", title: "Events" }, { id: "sb-107", project: "Sandbox", session: "SB-107", title: "Task Output", running: true }, ], }, ]; export function selectWorkspace( workspaces: TeamserverWorkspace[], workspaceId: string, ): TeamserverWorkspace | undefined { return workspaces.find(({ id }) => id === workspaceId); }