"use client"; import { useState } from "react"; import { Check, Copy } from "lucide-react"; /** PEP-126: a one-time code, large, with «Скопировать» — the person pastes it on another site. */ export function CopyCode({ code }: { code: string }) { const [copied, setCopied] = useState(false); async function copy() { try { await navigator.clipboard.writeText(code); setCopied(true); setTimeout(() => setCopied(false), 2500); } catch { /* no clipboard access: the code is selectable, the person copies it by hand */ } } return ( {code} ); }