File tree Expand file tree Collapse file tree 1 file changed +20
-16
lines changed
src/renderer/pages/backup Expand file tree Collapse file tree 1 file changed +20
-16
lines changed Original file line number Diff line number Diff line change @@ -76,25 +76,29 @@ const DiffViewerModal: React.FC<DiffViewerModalProps> = ({
7676 const renderContentWithHighlight = (
7777 content : string ,
7878 compareContent : string
79- ) : React . ReactElement [ ] => {
79+ ) : JSX . Element => {
8080 const lines = content . split ( "\n" ) ;
8181 const compareLines = compareContent . split ( "\n" ) ;
8282
83- return lines . map ( ( line , index ) => {
84- const isDifferent = compareLines [ index ] !== line ;
85- const style : React . CSSProperties = isDifferent
86- ? { backgroundColor : "#fff1f0" , color : "#cf1322" }
87- : { } ;
88-
89- // Use line content + index for unique key, avoiding array index alone
90- const uniqueKey = `${ line . substring ( 0 , 30 ) } -${ index } ` ;
91-
92- return (
93- < div key = { uniqueKey } style = { style } >
94- { line || " " }
95- </ div >
96- ) ;
97- } ) ;
83+ return (
84+ < >
85+ { lines . map ( ( line , index ) => {
86+ const isDifferent = compareLines [ index ] !== line ;
87+ const style : React . CSSProperties = isDifferent
88+ ? { backgroundColor : "#fff1f0" , color : "#cf1322" }
89+ : { } ;
90+
91+ // Use line content + index for unique key, avoiding array index alone
92+ const uniqueKey = `${ line . substring ( 0 , 30 ) } -${ index } ` ;
93+
94+ return (
95+ < div key = { uniqueKey } style = { style } >
96+ { line || " " }
97+ </ div >
98+ ) ;
99+ } ) }
100+ </ >
101+ ) ;
98102 } ;
99103
100104 return (
You can’t perform that action at this time.
0 commit comments