mirror of
https://github.com/nextui-org/nextui.git
synced 2025-12-08 19:26:11 +00:00
* refactor: improve dx for writing a docs component (#2544) * refactor: improve dx for write a docs component Signed-off-by: Innei <i@innei.in> * refactor(docs): switch to contentlayer2 * chore(docs): rename to avoid conflict * refactor(docs): switch to next-contentlayer2 * refactor(docs): revise docs lib * chore(deps): bump docs related dependencies * fix(use-aria-multiselect): type issue due to ts version bump --------- Signed-off-by: Innei <i@innei.in> Co-authored-by: WK Wong <wingkwong.code@gmail.com> * refactor(docs): accordion codes * feat(docs): declare module `*.jsx?raw` * feat(docs): include `**/*.jsx` * fix(docs): incorrect content * chore(docs): add new lines * refactor(docs): lint --------- Signed-off-by: Innei <i@innei.in> Co-authored-by: Innei <tukon479@gmail.com>
22 lines
498 B
TypeScript
22 lines
498 B
TypeScript
/* eslint-disable react/display-name */
|
|
"use client";
|
|
import type {MDXComponents as MDXComponentsType} from "mdx/types";
|
|
|
|
import {useMDXComponent} from "next-contentlayer2/hooks";
|
|
|
|
import {MDXComponents} from "./mdx-components";
|
|
|
|
interface MDXContentProps {
|
|
code: string;
|
|
}
|
|
|
|
export function MDXContent({code}: MDXContentProps) {
|
|
const Component = useMDXComponent(code);
|
|
|
|
return (
|
|
<div className="mdx">
|
|
<Component components={MDXComponents as MDXComponentsType} />
|
|
</div>
|
|
);
|
|
}
|