ant-design/.dumi/theme/builtins/Previewer/index.tsx
Wuxh 3ad2a34611
Revert "docs: fix debug demo style" (#41743)
* Revert "docs: fix debug demo style (#41738)"

This reverts commit d998c2fabc.

* chore: update
2023-04-11 10:13:58 +08:00

23 lines
595 B
TypeScript

import type { FC } from 'react';
import React from 'react';
import type { IPreviewerProps } from 'dumi';
import { useTabMeta } from 'dumi';
import CodePreviewer from './CodePreviewer';
import DesignPreviewer from './DesignPreviewer';
export interface AntdPreviewerProps extends IPreviewerProps {
originDebug?: IPreviewerProps['debug'];
}
const Previewer: FC<AntdPreviewerProps> = ({ ...props }) => {
const tab = useTabMeta();
if (tab?.frontmatter.title === 'Design') {
return <DesignPreviewer {...props} />;
}
return <CodePreviewer {...props} />;
};
export default Previewer;