ant-design/.dumi/theme/builtins/InstallDependencies/index.tsx
lijianan 81c26096be
docs: update site use-with-vite (#42906)
* docs: update use-with-vite

* update

* fix
2023-06-12 15:44:44 +08:00

57 lines
1.3 KiB
TypeScript

import { Tabs } from 'antd';
import SourceCode from 'dumi/theme-default/builtins/SourceCode';
import React from 'react';
import NpmLogo from './npm';
import PnpmLogo from './pnpm';
import YarnLogo from './yarn';
interface InstallProps {
npm?: string;
yarn?: string;
pnpm?: string;
}
const InstallDependencies: React.FC<InstallProps> = (props) => {
const { npm, yarn, pnpm } = props;
return (
<Tabs
className="antd-site-snippet"
defaultActiveKey="npm"
items={[
{
key: 'npm',
children: <SourceCode lang="bash">{npm}</SourceCode>,
label: (
<div className="snippet-label">
<NpmLogo />
<span>npm</span>
</div>
),
},
{
key: 'yarn',
children: <SourceCode lang="bash">{yarn}</SourceCode>,
label: (
<div className="snippet-label">
<YarnLogo />
<span>yarn</span>
</div>
),
},
{
key: 'pnpm',
children: <SourceCode lang="bash">{pnpm}</SourceCode>,
label: (
<div className="snippet-label">
<PnpmLogo />
<span>pnpm</span>
</div>
),
},
]}
/>
);
};
export default InstallDependencies;