ant-design/.dumi/theme/builtins/Previewer/index.tsx
thinkasany 0d31270277
site: optimization type & props (#43433)
* chore: optimization type & props

* fix: remove useless type
2023-07-07 18:28:13 +08:00

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;