MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / Collection

Function Collection

graph-ui/src/architecture/ArchitecturePanel.tsx:58–70  ·  view source on GitHub ↗

Pagination bounds DOM work while keeping every returned finding reachable.

({ items, children, empty, pageSize = 12 }: {
    items: T[]; children: (visible: T[]) => ReactNode; empty: string; pageSize?: number;
})

Source from the content-addressed store, hash-verified

56
57/** Pagination bounds DOM work while keeping every returned finding reachable. */
58function Collection<T>({ items, children, empty, pageSize = 12 }: {
59 items: T[]; children: (visible: T[]) => ReactNode; empty: string; pageSize?: number;
60}): JSX.Element {
61 const [limit, setLimit] = useState(pageSize);
62 if (items.length === 0) return <Empty>{empty}</Empty>;
63 return <>
64 {children(items.slice(0, limit))}
65 {items.length > pageSize && <div className="atlas-arch-pager">
66 <span>{text.results(Math.min(limit, items.length), items.length)}</span>
67 {limit < items.length && <button className="atlas-arch-action" onClick={() => setLimit(limit + pageSize)}>{text.showMore}</button>}
68 </div>}
69 </>;
70}
71
72function SourceLink({ path, line, name, onNavigate }: {
73 path?: string; line?: number; name?: string; onNavigate: ArchitecturePanelProps['onNavigate'];

Callers

nothing calls this directly

Calls 2

childrenFunction · 0.85
setLimitFunction · 0.85

Tested by

no test coverage detected