// A collapsible directory in the sidebar tree. Only a *collapsed* header is a // keyboard-walk stop (docs/SIDEBAR.md); an expanded one is decoration in front // of the cards it holds, so it carries no highlight of its own. import type { ReactNode } from "react"; import { splitFolderLabel } from "./model.js"; export interface FolderNodeProps { name: string; path: string; depth: number; collapsed: boolean; highlighted: boolean; onToggle(): void; children: ReactNode; } export function FolderNode(props: FolderNodeProps) { const { stem, last } = splitFolderLabel(props.name); return (