feat(playground): enhance Markdown component with improved styling and example formatting

This commit is contained in:
2025-01-11 02:09:29 +08:00
parent 1ae17e699b
commit ededbe8f1b
2 changed files with 12 additions and 6 deletions
+8 -6
View File
@@ -1,13 +1,14 @@
import { Suspense } from "react";
import { MDXRemote } from "next-mdx-remote/rsc";
import "github-markdown-css/github-markdown-dark.css";
import "../components/style/markdown.css";
export default function Markdown() {
return (
<Suspense fallback={<>Loading...</>}>
<div className="h-full w-full p-8 markdown-body">
<MDXRemote
source={`# 两数之和
source={`# 1. 两数之和
## 📝 问题描述
@@ -19,12 +20,13 @@ export default function Markdown() {
## 💡 示例
\`\`\`
输入:nums = [2, 7, 11, 15], target = 9
输出:[0, 1]
解释:因为 nums[0] + nums[1] == 9 ,返回 [0, 1]。
\`\`\`
### 示例 1:
> 输入:nums = [2,7,11,15], target = 9
>
> 输出:[0,1]
>
> 解释:因为 nums[0] + nums[1] == 9 ,返回 [0, 1] 。
`}
/>
</div>
@@ -0,0 +1,4 @@
.markdown-body {
background-color: #282c34;
border: #3e4452;
}