(props: Props)
| 23 | }; |
| 24 | |
| 25 | export function FileEditToolDiff(props: Props): React.ReactNode { |
| 26 | // Snapshot on mount — the diff must stay consistent even if the file changes |
| 27 | // while the dialog is open. useMemo on props.edits would re-read the file on |
| 28 | // every render because callers pass fresh array literals. |
| 29 | const [dataPromise] = useState(() => loadDiffData(props.file_path, props.edits)); |
| 30 | return ( |
| 31 | <Suspense fallback={<DiffFrame placeholder />}> |
| 32 | <DiffBody promise={dataPromise} file_path={props.file_path} /> |
| 33 | </Suspense> |
| 34 | ); |
| 35 | } |
| 36 | |
| 37 | function DiffBody({ promise, file_path }: { promise: Promise<DiffData>; file_path: string }): React.ReactNode { |
| 38 | const { patch, firstLine, fileContent } = use(promise); |
nothing calls this directly
no test coverage detected