feat: Display pending connection request count on the agent dashboard profile card.
This commit is contained in:
@@ -22,6 +22,7 @@ interface ProfileCardProps {
|
||||
editHref?: string;
|
||||
messageHref?: string;
|
||||
requestsHref?: string;
|
||||
pendingRequestCount?: number;
|
||||
connectionStatus?: ConnectionStatus;
|
||||
onConnectClick?: () => void; // Callback when Connect button is clicked (for opening modal)
|
||||
onUnlinkClick?: () => void; // Callback when Unlink button is clicked
|
||||
@@ -40,6 +41,7 @@ export function ProfileCard({
|
||||
editHref = '/agent/edit',
|
||||
messageHref,
|
||||
requestsHref,
|
||||
pendingRequestCount = 0,
|
||||
connectionStatus,
|
||||
onConnectClick,
|
||||
onUnlinkClick,
|
||||
@@ -168,11 +170,11 @@ export function ProfileCard({
|
||||
</button>
|
||||
)}
|
||||
{showEditButton && requestsHref ? (
|
||||
// Agent's own profile - show Requests link
|
||||
// Agent's own profile - show Requests link with badge
|
||||
<Link
|
||||
href={requestsHref}
|
||||
onClick={(e) => handleActionClick(e, requestsHref)}
|
||||
className="flex items-center gap-2 px-4 py-1.5 bg-[#e58625] text-[#00293d] text-sm font-normal rounded-[15px] border border-[#00293d]/10 hover:bg-[#d47720] transition-colors font-serif cursor-pointer"
|
||||
className="relative flex items-center gap-2 px-4 py-1.5 bg-[#e58625] text-[#00293d] text-sm font-normal rounded-[15px] border border-[#00293d]/10 hover:bg-[#d47720] transition-colors font-serif cursor-pointer"
|
||||
>
|
||||
<Image
|
||||
src="/assets/icons/requests-dark-icon.svg"
|
||||
@@ -181,6 +183,11 @@ export function ProfileCard({
|
||||
height={13}
|
||||
/>
|
||||
Requests
|
||||
{pendingRequestCount > 0 && (
|
||||
<span className="absolute -top-2 -right-2 min-w-[20px] h-[20px] flex items-center justify-center px-1 bg-red-500 text-white text-[11px] font-bold rounded-full">
|
||||
{pendingRequestCount > 99 ? '99+' : pendingRequestCount}
|
||||
</span>
|
||||
)}
|
||||
</Link>
|
||||
) : (
|
||||
// Public view - show Connect/Pending/Unlink button based on connection status
|
||||
|
||||
Reference in New Issue
Block a user