import { Tab, TabGroup, TabList, TabPanel, TabPanels } from "@headlessui/react"; import React from "react"; import { HTMLAttributes } from "react"; import { Check, Copy } from "lucide-react"; import { useState } from "react"; import { Button } from "./retroui"; interface IComponentShowcase extends HTMLAttributes {} const CopyableCommand = ({ command }: { command: string }) => { const [copied, setCopied] = useState(false); const copyToClipboard = async () => { await navigator.clipboard.writeText(command); setCopied(true); setTimeout(() => setCopied(false), 2000); }; return (
{command}
); }; export function CliCommand({ npmCommand, yarnCommand, pnpmCommand, bunCommand, }: { npmCommand: string; yarnCommand?: string; pnpmCommand?: string; bunCommand?: string; }) { const isNpx = npmCommand.includes("npx"); if (isNpx) { pnpmCommand = pnpmCommand ?? npmCommand.replace("npx", "pnpm dlx"); yarnCommand = yarnCommand ?? npmCommand.replace("npx", "yarn dlx"); bunCommand = bunCommand ?? npmCommand.replace("npx", "bunx"); } else { pnpmCommand = pnpmCommand ?? npmCommand.replace("npm", "pnpm"); yarnCommand = yarnCommand ?? npmCommand.replace("npm install", "yarn add"); bunCommand = bunCommand ?? npmCommand.replace("npm", "bun"); } return ( pnpm npm yarn bun ); } function ComponentInstallCli({ npmCommand, yarnCommand, pnpmCommand, bunCommand, }: { npmCommand: string; yarnCommand?: string; pnpmCommand?: string; bunCommand?: string; }) { return ( ); } function ComponentInstallManual({ children }: { children: React.ReactNode }) { return {children}; } function ComponentInstall({ children }: IComponentShowcase) { return ( CLI Manual {children} ); } Object.assign(ComponentInstall, { Cli: ComponentInstallCli, Manual: ComponentInstallManual, }); export { ComponentInstall };