Files
backerup-website/frontend/app/files/[token]/CopyLinkButton.tsx
T
Anders Böttcher 50566f2a22 Initial Commit
2026-05-11 23:39:16 +02:00

19 lines
560 B
TypeScript

"use client";
export default function CopyLinkButton({ token }: { token: string }) {
function copy() {
const url = `${window.location.origin}/files/${token}`;
navigator.clipboard.writeText(url).then(() => {
alert("Link copied to clipboard!");
});
}
return (
<button
onClick={copy}
className="flex w-full items-center justify-center gap-2 rounded-xl border border-slate-700 py-3 text-sm font-semibold text-slate-300 hover:bg-slate-800 hover:text-white transition-colors"
>
Copy share link
</button>
);
}