import { useState } from 'react'; import { Copy, Check, Play } from 'lucide-react'; import { copyToClipboard } from 'helpers/clipboard'; type CommandBlockProps = { label?: string; command: string; onRun?: (command: string) => void; }; export const CommandBlock = ({ label, command, onRun }: CommandBlockProps) => { const [copied, setCopied] = useState(false); const copy = () => { copyToClipboard(command); setCopied(true); setTimeout(() => setCopied(false), 1500); }; return (
{command}
{onRun && (
)}