fix build errors

This commit is contained in:
Mohamed Ashraf 2025-11-07 22:54:08 +02:00
parent ee1400a0f6
commit 41e9c40b5f

View file

@ -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>