import { Copy } from 'lucide-react' import { useMemo, useState } from 'react' import { Button, copyToClipboard } from 'ui' import type { StepContentProps } from '@/components/interfaces/ConnectSheet/Connect.types' function getShadcnCommand(state: StepContentProps['state']): string | null { if (state.framework === 'nextjs') { return 'npx shadcn@latest add @supabase/supabase-client-nextjs' } if (state.framework === 'react') { return 'npx shadcn@latest add @supabase/supabase-client-react-router' } return null } function ShadcnCommandContent({ state }: StepContentProps) { const command = useMemo(() => getShadcnCommand(state), [state]) const [copyLabel, setCopyLabel] = useState('Copy') if (!command) return null const handleCopy = () => { copyToClipboard(command, () => { setCopyLabel('Copied') setTimeout(() => setCopyLabel('Copy'), 2000) }) } return (
{command}