Skip to content

Commit

Permalink
render image
Browse files Browse the repository at this point in the history
  • Loading branch information
v1xingyue committed Jan 9, 2025
1 parent 978c031 commit b31e436
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions packages/page/src/components/MarkdownContent.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,17 @@
import { ReactNode, type ReactElement } from "react";
import ReactMarkdown from "react-markdown";
import type { Components } from "react-markdown/lib/ast-to-react";
import type { Components } from "react-markdown";

const baseUrl = "https://github.com/CreatorsDAO/eliza101/blob/main/docs/";

interface MarkdownContentProps {
content: string;
}

const components: Partial<Components> = {
img: ({
node,
src,
alt,
...props
}: {
node: any;
src: string;
alt: string;
props: any;
}) => (
img: ({ src, alt, ...props }) => (
<img
src={`https://github.com/CreatorsDAO/eliza101/blob/main/docs/${src}?raw=true`}
src={`${baseUrl}${src}?raw=true`}
alt={alt || "Image"}
className="w-full h-auto"
loading="lazy"
Expand Down

0 comments on commit b31e436

Please sign in to comment.