diff --git a/src/components/download/Checksum.tsx b/src/components/download/Checksum.tsx index e304c0f0..e28f989b 100644 --- a/src/components/download/Checksum.tsx +++ b/src/components/download/Checksum.tsx @@ -1,4 +1,5 @@ -import { Shield } from 'lucide-react'; +import { Shield, Clipboard } from 'lucide-react'; +import { useState } from 'react'; interface ChecksumProps { sha256: string; @@ -6,24 +7,63 @@ interface ChecksumProps { } export function Checksum({ sha256, gpg }: ChecksumProps) { + const [copied, setCopied] = useState<"sha256" | "gpg" | null>(null); + + const handleCopy = (text: string, type: "sha256" | "gpg") => { + navigator.clipboard.writeText(text).then(() => { + setCopied(type); + setTimeout(() => setCopied(null), 2000); // Reset feedback after 2 seconds + }); + }; + return ( -
-
- -

Verify Download

+
+
+ +

Verify Download

- -
-
-

SHA256 Checksum

- {sha256} + +
+ {/* SHA256 Checksum */} +
+
+

SHA256 Checksum

+ + {sha256} + +
+
- -
-

GPG Signature

- {gpg} + + {/* GPG Signature */} +
+
+

GPG Signature

+ + {gpg} + +
+
); -} \ No newline at end of file +}