fix build errors
This commit is contained in:
parent
ee1400a0f6
commit
41e9c40b5f
1 changed files with 9 additions and 3 deletions
|
|
@ -698,7 +698,13 @@ const MonacoDiffViewer: React.FC<MonacoDiffViewerProps> = ({
|
|||
</div>
|
||||
)
|
||||
},
|
||||
code: ({ node, inline, className, children, ...props }) => {
|
||||
code: props => {
|
||||
const { inline, className, children, ...restProps } = props as {
|
||||
inline?: boolean
|
||||
className?: string
|
||||
children: React.ReactNode
|
||||
[key: string]: unknown
|
||||
}
|
||||
const match = /language-(\w+)/.exec(className || "")
|
||||
const language = match ? match[1] : null
|
||||
|
||||
|
|
@ -715,14 +721,14 @@ const MonacoDiffViewer: React.FC<MonacoDiffViewerProps> = ({
|
|||
fontSize: "0.75rem",
|
||||
lineHeight: "1.5",
|
||||
}}
|
||||
{...props}
|
||||
{...restProps}
|
||||
>
|
||||
{String(children).replace(/\n$/, "")}
|
||||
</SyntaxHighlighter>
|
||||
) : (
|
||||
<code
|
||||
className="bg-slate-700/50 px-1 py-0.5 rounded text-xs text-cyan-300 font-mono"
|
||||
{...props}
|
||||
{...restProps}
|
||||
>
|
||||
{children}
|
||||
</code>
|
||||
|
|
|
|||
Loading…
Reference in a new issue