加载版本历史...
;
+
+ return (
+
+
版本历史
+
+ 点击一个版本查看内容,点击两个版本对比差异
+
+
+
+ {history.map(entry => {
+ const isSelected = selected && (selected[0] === entry.hash || selected[1] === entry.hash);
+ return (
+
+
handleSelectForDiff(entry.hash)}>
+ {entry.shortHash}
+ {entry.message}
+
+ {new Date(entry.date).toLocaleString('zh-CN')}
+
+ {entry.author}
+
+
+
+ );
+ })}
+
+
+ {/* 版本内容预览 */}
+ {viewingHash && versionContent !== null && (
+
+
+ 版本 {viewingHash.substring(0, 7)}
+
+
+
{versionContent}
+
+ )}
+
+ {/* Diff 视图 */}
+ {diff && selected && (
+
+
+
+ 对比: {selected[1].substring(0, 7)} → {selected[0].substring(0, 7)}
+
+
+ +{diff.additions} / -{diff.deletions}
+
+
+
+
+ {diff.hunks.map((hunk, i) => (
+
+ {hunk.lines.map((line, j) => (
+
+ {line}
+
+ ))}
+
+ ))}
+
+
+ )}
+
+ );
+}
diff --git a/product-source/guanghu-knowledge-base/src/main.tsx b/product-source/guanghu-knowledge-base/src/main.tsx
new file mode 100644
index 0000000..3952c72
--- /dev/null
+++ b/product-source/guanghu-knowledge-base/src/main.tsx
@@ -0,0 +1,10 @@
+import React from 'react';
+import ReactDOM from 'react-dom/client';
+import App from './App';
+import './styles/app.css';
+
+ReactDOM.createRoot(document.getElementById('root')!).render(
+