mirror of
https://github.com/langgenius/dify.git
synced 2026-05-04 09:28:04 +08:00
Refactor/markdown component split (#20177)
This commit is contained in:
21
web/app/components/base/markdown-blocks/pre-code.tsx
Normal file
21
web/app/components/base/markdown-blocks/pre-code.tsx
Normal file
@ -0,0 +1,21 @@
|
||||
/**
|
||||
* @fileoverview PreCode component for rendering <pre> tags in Markdown.
|
||||
* Extracted from the main markdown renderer for modularity.
|
||||
* This is a simple wrapper around the HTML <pre> element.
|
||||
*/
|
||||
import React, { useRef } from 'react'
|
||||
|
||||
function PreCode(props: { children: any }) {
|
||||
const ref = useRef<HTMLPreElement>(null)
|
||||
|
||||
return (
|
||||
<pre ref={ref}>
|
||||
<span
|
||||
className="copy-code-button"
|
||||
></span>
|
||||
{props.children}
|
||||
</pre>
|
||||
)
|
||||
}
|
||||
|
||||
export default PreCode
|
||||
Reference in New Issue
Block a user