"use client"; import { useState } from "react"; interface CopyButtonProps { value: string; label?: string; } export function CopyButton({ value, label = "Salin" }: CopyButtonProps) { const [copied, setCopied] = useState(false); async function handleClick() { try { await navigator.clipboard.writeText(value); setCopied(true); setTimeout(() => setCopied(false), 1500); } catch { // ignore — user can copy manually } } return ( ); }