fix: oops

This commit is contained in:
phact 2025-09-18 16:09:25 -04:00
parent 0468740f3e
commit 5c7196437b
2 changed files with 0 additions and 65 deletions

View file

@ -1,43 +0,0 @@
"use client";
import React from "react";
// Type-safe wrapper that bypasses react-markdown typing issues
interface MarkdownWrapperProps {
children: string;
remarkPlugins?: any[];
rehypePlugins?: any[];
linkTarget?: string;
components?: any;
}
const MarkdownWrapper: React.FC<MarkdownWrapperProps> = ({
children,
remarkPlugins,
rehypePlugins,
linkTarget,
components
}) => {
const [MarkdownComponent, setMarkdownComponent] = React.useState<any>(null);
React.useEffect(() => {
// Dynamically import react-markdown at runtime to avoid build-time type issues
import("react-markdown").then((mod) => {
setMarkdownComponent(() => mod.default);
});
}, []);
if (!MarkdownComponent) {
return <div>Loading markdown...</div>;
}
return React.createElement(MarkdownComponent, {
remarkPlugins,
rehypePlugins,
linkTarget,
components,
children,
});
};
export default MarkdownWrapper;

View file

@ -1,22 +0,0 @@
import React from 'react';
declare global {
namespace JSX {
interface IntrinsicElements {
[elemName: string]: any;
}
}
}
declare module 'react-markdown' {
interface ReactMarkdownProps {
children: string;
remarkPlugins?: any[];
rehypePlugins?: any[];
linkTarget?: string;
components?: any;
}
const ReactMarkdown: React.FC<ReactMarkdownProps>;
export default ReactMarkdown;
}