"use client"; import { useEffect, useRef, useState } from "react"; interface Props { text: string; /** Visible label, e.g. "Copy program". Pass empty string to render * icon-only (the visually-hidden `aria-label` still applies). */ label?: string; ariaLabel?: string; /** "default" = full bordered button with label; "icon" = compact * icon-only (for inside tiles). */ variant?: "default" | "icon"; /** Optional className override. */ className?: string; /** Click handler for the host to know a copy happened (e.g. analytics * or downstream UI). */ onCopied?: () => void; } /** * Reusable copy-to-clipboard button. * * Uses ``navigator.clipboard.writeText`` when available; degrades to a * hidden ``