Files
t5de-site/components/copy-button.tsx
T
dhkatzandClaude Opus 5.5 8401f30f78
CI / test (push) Successful in 13s
CI / image (push) Successful in 12s
Release / release (push) Successful in 3s
feat: T5DE's website: landing page, download, changelog and FAQ
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-03 01:55:42 -08:00

24 lines
609 B
TypeScript

"use client";
import { CheckIcon, CopyIcon } from "lucide-react";
import { useState } from "react";
import { Button } from "@/components/ui/button";
export function CopyButton({ text }: { text: string }) {
const [copied, setCopied] = useState(false);
return (
<Button
type="button"
variant="outline"
size="sm"
onClick={async () => {
await navigator.clipboard.writeText(text);
setCopied(true);
setTimeout(() => setCopied(false), 2000);
}}
>
{copied ? <CheckIcon /> : <CopyIcon />}
{copied ? "Copied" : "Copy"}
</Button>
);
}