ant-design/.dumi/theme/builtins/InstallDependencies/index.tsx
lijianan 4a6c09ca2a
site: site optimization (#43007)
* site: site optimization

* Update practical-projects.zh-CN.md
2023-06-14 16:28:38 +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: (
<span className="snippet-label">
<NpmLogo />
npm
</span>
),
},
{
key: 'yarn',
children: <SourceCode lang="bash">{yarn}</SourceCode>,
label: (
<span className="snippet-label">
<YarnLogo />
yarn
</span>
),
},
{
key: 'pnpm',
children: <SourceCode lang="bash">{pnpm}</SourceCode>,
label: (
<span className="snippet-label">
<PnpmLogo />
pnpm
</span>
),
},
]}
/>
);
};
export default InstallDependencies;