bugfix: copy/regenerate link for invitation action added to connection request lis in orgs feature.

This commit is contained in:
2026-05-17 13:13:59 +03:30
parent 09b511a136
commit 046257c071
14 changed files with 384 additions and 171 deletions

View File

@@ -0,0 +1,38 @@
'use client';
import { Check, Copy } from 'lucide-react';
import {
canShareOrganizationInviteLink,
type InvitationLinkTarget,
} from '@/components/invitations/organizationInviteLinks';
type CopyInvitationLinkButtonProps = {
invitation: InvitationLinkTarget;
copied: boolean;
copying: boolean;
onCopy: () => void;
};
export function CopyInvitationLinkButton({
invitation,
copied,
copying,
onCopy,
}: CopyInvitationLinkButtonProps) {
if (!canShareOrganizationInviteLink(invitation)) {
return <span className="text-xs text-text-muted"></span>;
}
return (
<button
type="button"
className="p-2 rounded-md text-text-secondary hover:bg-background-card/80 hover:text-text-primary disabled:opacity-50"
disabled={copying}
onClick={onCopy}
aria-label="Copy invitation link"
title="Copy invitation link (generates a new link if needed)"
>
{copied ? <Check className="w-4 h-4" /> : <Copy className="w-4 h-4" />}
</button>
);
}