'use client'; import { useState } from 'react'; import { Check, Copy } from 'lucide-react'; import { cn } from '@/lib/cn'; export function InstallCommand({ command, className, copyLabel = 'Copy install command', copiedLabel = 'Copied', }: { command: string; className?: string; copyLabel?: string; copiedLabel?: string; }) { const [copied, setCopied] = useState(false); async function copy() { try { await navigator.clipboard.writeText(command); setCopied(true); setTimeout(() => setCopied(false), 2000); } catch { // Clipboard unavailable (insecure context) — silently ignore. } } return (
$ {/* Commands are always LTR, even on RTL pages. */} {command}
); }