import { useState } from 'react' import { ChevronDown, ChevronUp } from 'lucide-react' import { getRelativePath } from './FileToolRender' interface StepFileChangesProps { files: string[] snapshot?: string onFileClick?: (filePath: string) => void } const INITIAL_FILES_SHOWN = 3 function fileNoun(count: number): string { return count === 1 ? 'file' : 'files' } export function StepFileChanges({ files, snapshot, onFileClick }: StepFileChangesProps) { const [expanded, setExpanded] = useState(false) if (files.length === 0) return null const hasMoreFiles = files.length > INITIAL_FILES_SHOWN const displayedFiles = expanded ? files : files.slice(0, INITIAL_FILES_SHOWN) const hiddenCount = files.length - INITIAL_FILES_SHOWN return (
{displayedFiles.map((file) => ( ))} {hasMoreFiles && ( )}
) }