import SourceCode from 'dumi/theme-default/builtins/SourceCode'; import React from 'react'; import type { TabsProps } from 'antd'; import { ConfigProvider, Tabs } from 'antd'; import { createStyles, css } from 'antd-style'; import NpmLogo from './npm'; import PnpmLogo from './pnpm'; import YarnLogo from './yarn'; interface InstallProps { npm?: string; yarn?: string; pnpm?: string; } const useStyle = createStyles(() => ({ packageManager: css` display: flex; align-items: center; justify-content: center; svg { margin-inline-end: 8px; } `, })); const InstallDependencies: React.FC = (props) => { const { npm, yarn, pnpm } = props; const { styles } = useStyle(); const items = React.useMemo( () => [ { key: 'npm', children: npm ? {npm} : null, label: (
npm
), }, { key: 'yarn', children: yarn ? {yarn} : null, label: (
yarn
), }, { key: 'pnpm', children: pnpm ? {pnpm} : null, label: (
pnpm
), }, ].filter((item) => item.children), [npm, yarn, pnpm], ); return ( ); }; export default InstallDependencies;