ant-design/.dumi/theme/builtins/Previewer/index.tsx

22 lines
561 B
TypeScript
Raw Normal View History

import type { IPreviewerProps } from 'dumi';
import { useTabMeta } from 'dumi';
import React from 'react';
import CodePreviewer from './CodePreviewer';
import DesignPreviewer from './DesignPreviewer';
export interface AntdPreviewerProps extends IPreviewerProps {
originDebug?: IPreviewerProps['debug'];
}
const Previewer: React.FC<AntdPreviewerProps> = (props) => {
const tab = useTabMeta();
if (tab?.frontmatter.title === 'Design') {
return <DesignPreviewer {...props} />;
2016-02-29 14:08:40 +08:00
}
return <CodePreviewer {...props} />;
};
2019-08-08 12:35:48 +08:00
export default Previewer;