mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-12 07:09:55 +08:00
0d31270277
* chore: optimization type & props * fix: remove useless type
22 lines
561 B
TypeScript
22 lines
561 B
TypeScript
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} />;
|
|
}
|
|
|
|
return <CodePreviewer {...props} />;
|
|
};
|
|
|
|
export default Previewer;
|