Skip to content

Commit 7b5dcfd

Browse files
committed
fix: ToolDeveloperGuide 替换内联 CodeBlock 为共享组件(修复语法高亮)
1 parent f84eee3 commit 7b5dcfd

1 file changed

Lines changed: 1 addition & 16 deletions

File tree

src/pages/ToolDeveloperGuide.tsx

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { useState } from 'react';
2+
import { CodeBlock } from '../components/CodeBlock';
23
import { RelatedPages } from '../components/RelatedPages';
34

45
// ============================================================
@@ -44,22 +45,6 @@ function CollapsibleSection({
4445
);
4546
}
4647

47-
// 代码块组件
48-
function CodeBlock({ code, language = 'typescript', title }: { code: string; language?: string; title?: string }) {
49-
return (
50-
<div className="my-4 rounded-lg overflow-hidden border border-edge/50">
51-
{title && (
52-
<div className="bg-surface px-4 py-2 text-sm text-body border- border-edge/50">
53-
{title}
54-
</div>
55-
)}
56-
<pre className={`bg-base/80 p-4 overflow-x-auto language-${language}`}>
57-
<code className="text-sm text-body">{code}</code>
58-
</pre>
59-
</div>
60-
);
61-
}
62-
6348
// 设计原理卡片
6449
function DesignRationaleCard({ title, why, how, benefit }: {
6550
title: string;

0 commit comments

Comments
 (0)