import { fileSummary } from '#/lib/collab.js'; /** * A set of paths as one line, opening to the whole list. * * A pull request written by an agent touches tens of files, and a card that * prints them all says nothing else. The line carries the count and where the * paths are; the list underneath is for the reader who wants it. * * A short list is its own summary, so up to `inline` paths are printed * outright and nothing opens. */ export function PathList({ paths, label = '', inline = 3, className = '' }) { if (paths.length === 0) return null; const { count, dirs } = fileSummary(paths); const lead = label ? `${label} ` : ''; if (count <= inline) { return ( {lead} {paths.join(' ')} ); } const where = dirs.length === 1 ? `in ${dirs[0].dir || 'the root'}` : `across ${dirs.length} directories`; return (
{lead} {count} files {where}
{paths.map((path) => ( {path} ))}
); }