From 85c77007f05012f598063bc536ea90b577e2c10d Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Fri, 8 May 2026 17:44:40 +0900 Subject: [PATCH] feat(web): add MDX components for documentation rendering --- web/components/docs/mdx-components.tsx | 140 +++++++++++++++++++++++++ 1 file changed, 140 insertions(+) create mode 100644 web/components/docs/mdx-components.tsx diff --git a/web/components/docs/mdx-components.tsx b/web/components/docs/mdx-components.tsx new file mode 100644 index 000000000..a664188e2 --- /dev/null +++ b/web/components/docs/mdx-components.tsx @@ -0,0 +1,140 @@ +import * as React from "react" +import { cn } from "@/lib/utils" + +type WithChildren = { children?: React.ReactNode; className?: string } + +export const mdxComponents = { + h1: ({ children, className, ...props }: WithChildren) => ( +

+ {children} +

+ ), + h2: ({ children, className, ...props }: WithChildren) => ( +

+ {children} +

+ ), + h3: ({ children, className, ...props }: WithChildren) => ( +

+ {children} +

+ ), + h4: ({ children, className, ...props }: WithChildren) => ( +

+ {children} +

+ ), + p: ({ children, className, ...props }: WithChildren) => ( +

+ {children} +

+ ), + a: ({ children, href, className, ...props }: WithChildren & { href?: string }) => ( + + {children} + + ), + ul: ({ children, className, ...props }: WithChildren) => ( + + ), + ol: ({ children, className, ...props }: WithChildren) => ( +
    + {children} +
+ ), + li: ({ children, className, ...props }: WithChildren) => ( +
  • + {children} +
  • + ), + blockquote: ({ children, className, ...props }: WithChildren) => ( +
    + {children} +
    + ), + code: ({ children, className, ...props }: WithChildren) => ( + + {children} + + ), + pre: ({ children, className, ...props }: WithChildren) => ( +
    +      {children}
    +    
    + ), + table: ({ children, className, ...props }: WithChildren) => ( +
    + + {children} +
    +
    + ), + thead: ({ children, className, ...props }: WithChildren) => ( + + {children} + + ), + th: ({ children, className, ...props }: WithChildren) => ( + + {children} + + ), + td: ({ children, className, ...props }: WithChildren) => ( + + {children} + + ), + hr: ({ className, ...props }: { className?: string }) => ( +
    + ), + strong: ({ children, className, ...props }: WithChildren) => ( + + {children} + + ), +}