import type { RootInfo } from "../api"; import { Icon } from "./Icon"; import { baseName } from "../paths"; // One directory row, shared by the composer popover and the session start panel. The primary is the // session's bound workspace — the repo/folder for Code/Ops (shown by name), or a throwaway scratch // for Cowork (shown as "Temporary space"). It's always read-write and can't be removed. export function RootRow({ root, busy, scratchPrimary, branch, onToggle, onRemove, }: { root: RootInfo; busy?: boolean; scratchPrimary?: boolean; // The workspace's git branch — shown on the primary row (drawer's Working directories, §23). branch?: string | null; onToggle: (r: RootInfo) => void; onRemove: (path: string) => void; }) { const label = root.primary ? scratchPrimary ? "Temporary space" : baseName(root.path) : root.label; return (