mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-30 04:18:28 +08:00
32052bf5d8
* docs: update live demo api with dumi 2.3 beta * docs: lint fix * refactor: update naming of demo source * feat: optimize souce code editor style * chore: update dumi version * chore: restore dumi overrides * ci: setup before lint only for ci * chore: trigger ci re-run * chore: bump dumi version --------- Signed-off-by: lijianan <574980606@qq.com> Co-authored-by: MadCcc <1075746765@qq.com> Co-authored-by: lijianan <574980606@qq.com>
23 lines
562 B
TypeScript
23 lines
562 B
TypeScript
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: React.FC<AntdPreviewerProps> = (props) => {
|
|
const tab = useTabMeta();
|
|
|
|
if (tab?.frontmatter.title === 'Design') {
|
|
return <DesignPreviewer {...props} />;
|
|
}
|
|
|
|
return <CodePreviewer {...props} />;
|
|
};
|
|
|
|
export default Previewer;
|