mirror of
https://github.com/langgenius/dify.git
synced 2025-07-06 16:49:09 +00:00
22 lines
488 B
TypeScript
22 lines
488 B
TypeScript
![]() |
/**
|
||
|
* @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
|