/** * WorkstreamSwitcher component. * * Displays the current branch in a trigger button and opens a dropdown that * lists all branches with search filtering. Provides an inline "New workstream" * create form in the footer when `onCreateBranch` is supplied. * * The dropdown uses createPortal + position:fixed so it escapes any * overflow:hidden or z-index constraints on ancestor elements. */ import React from 'react'; import type { Branch } from '@pantheon-systems/css-client'; export interface WorkstreamSwitcherProps { branches: Branch[]; currentBranch: Branch | null; onSwitch: (branchId: string) => void; /** * Called when the user creates a new workstream branch. When omitted, the * "New workstream" footer is not rendered at all. */ onCreateBranch?: (name: string) => Promise; /** * Called every time the dropdown opens (trigger click or `openCreateForm`). * `branches` is otherwise only refreshed once on mount, so a workstream * created elsewhere (another tab, the dashboard, or an API call) doesn't * show up here until something else happens to refetch it. Wire this to a * refetch of the branch list; errors are the caller's responsibility, this * component doesn't await it. */ onOpen?: () => void; } export interface WorkstreamSwitcherHandle { /** Opens the dropdown with the "New workstream" form showing. No-op without `onCreateBranch`. */ openCreateForm: () => void; } export declare const WorkstreamSwitcher: React.ForwardRefExoticComponent>;