TabsPackage.tsx 589 B

123456789101112131415161718192021222324
  1. import { Pre } from '@/components/mdx/Code';
  2. import { Tab, Tabs } from '@/components/mdx/Tabs';
  3. export function TabsPackage({ name }) {
  4. return (
  5. <Tabs items={['yarn', 'npm', 'pnpm']}>
  6. <Tab>
  7. <Pre>
  8. <code className="language-plaintext">yarn add {name}</code>
  9. </Pre>
  10. </Tab>
  11. <Tab>
  12. <Pre>
  13. <code className="language-plaintext">npm install {name}</code>
  14. </Pre>
  15. </Tab>
  16. <Tab>
  17. <Pre>
  18. <code className="language-plaintext">pnpm install {name}</code>
  19. </Pre>
  20. </Tab>
  21. </Tabs>
  22. );
  23. }