11import FullTooltip from "@components/FullTooltip" ;
2+ import InlineLink from "@components/InlineLink" ;
23import { cn } from "@utils/helpers" ;
3- import { HelpCircle } from "lucide-react" ;
4+ import { ExternalLinkIcon , HelpCircle } from "lucide-react" ;
45import React from "react" ;
56import { User } from "@/interfaces/User" ;
67
@@ -14,7 +15,7 @@ export default function UserStatusCell({ user }: Readonly<Props>) {
1415
1516 const getStatusDisplay = ( ) => {
1617 if ( isPendingApproval ) {
17- return { text : "Pending Approval" , color : "bg-orange-400 " } ;
18+ return { text : "Pending Approval" , color : "bg-netbird " } ;
1819 }
1920 if ( status === "blocked" ) {
2021 return { text : "Blocked" , color : "bg-red-500" } ;
@@ -31,32 +32,54 @@ export default function UserStatusCell({ user }: Readonly<Props>) {
3132 const { text, color } = getStatusDisplay ( ) ;
3233
3334 return (
34- < div
35- className = { cn ( "flex gap-2.5 items-center text-nb-gray-300 text-sm" ) }
36- data-cy = { "user-status-cell" }
37- >
38- < span className = { cn ( "h-2 w-2 rounded-full" , color ) } > </ span >
39- { text }
40- { isPendingApproval && (
41- < FullTooltip
42- content = {
43- < div className = { "max-w-xs text-xs" } >
44- < p > This user requires approval from an administrator.</ p >
45- < p className = "mt-2" >
46- To disable user approval requirements for new users, go to the account{ " " }
47- < span className = "text-nb-gray-200 inline-flex gap-1 items-center max-h-[22px] font-medium bg-nb-gray-900 py-[3px] text-[11px] px-[5px] border border-nb-gray-800 rounded-[4px]" >
48- Settings
49- </ span > { " " }
50- and disable "User Approval Required".
51- </ p >
35+ < div onClick = { ( e ) => e . stopPropagation ( ) } >
36+ < FullTooltip
37+ content = {
38+ < div className = { "max-w-xs text-xs flex flex-col gap-2" } >
39+ < div >
40+ This user needs to be approved by an administrator before it can
41+ join your organization.
5242 </ div >
53- }
54- interactive = { true }
55- side = "right"
43+
44+ < div >
45+ If you want to disable approval for new users, go to{ " " }
46+ < InlineLink href = { "/settings?tab=authentication" } >
47+ Settings
48+ </ InlineLink > { " " }
49+ and disable{ " " }
50+ < span className = { "font-medium text-white" } >
51+ { "'User Approval Required'" }
52+ </ span >
53+ .
54+ </ div >
55+ < div >
56+ Learn more about{ " " }
57+ < InlineLink
58+ href = {
59+ "https://docs.netbird.io/how-to/add-users-to-your-network#user-approval"
60+ }
61+ target = { "_blank" }
62+ >
63+ User Approval < ExternalLinkIcon size = { 12 } />
64+ </ InlineLink >
65+ </ div >
66+ </ div >
67+ }
68+ interactive = { true }
69+ side = "right"
70+ disabled = { ! isPendingApproval }
71+ >
72+ < div
73+ className = { cn ( "flex gap-2.5 items-center text-nb-gray-300 text-sm" ) }
74+ data-cy = { "user-status-cell" }
5675 >
57- < HelpCircle size = { 14 } className = "text-orange-400 cursor-help" />
58- </ FullTooltip >
59- ) }
76+ < span className = { cn ( "h-2 w-2 rounded-full" , color ) } > </ span >
77+ { text }
78+ { isPendingApproval && (
79+ < HelpCircle size = { 14 } className = "text-netbird cursor-help" />
80+ ) }
81+ </ div >
82+ </ FullTooltip >
6083 </ div >
6184 ) ;
6285}
0 commit comments