@@ -14,7 +14,6 @@ import React, { useEffect, useState } from "react";
1414import { dateConversion } from "@/config/common.functions" ;
1515import {
1616 invitationsApi ,
17- signOutApi ,
1817} from "@/config/constant" ;
1918import { getRequest , postRequest } from "@/config/apiCalls" ;
2019
@@ -23,15 +22,13 @@ import { CellContext } from "@tanstack/react-table";
2322import { DataTable } from "@/components/ui/generic-table-component/data-table" ;
2423import Modal from "@/components/Modal" ;
2524import { RefreshCw } from "lucide-react" ;
26- import { signOut } from "next-auth/react" ;
27- import { useAppSelector } from "@/lib/hooks" ;
28- import { useRouter } from "next/navigation" ;
2925import { Input } from "@/components/ui/input" ;
30- import Alert from "@/components/alert" ;
3126import { HttpStatusCode } from "axios" ;
3227import { AlertComponent } from "@/components/AlertComponent" ;
3328import { TooltipContent , TooltipProvider , TooltipTrigger , Tooltip } from "@/components/ui/tooltip" ;
3429import { Formik , Form as FormikForm } from "formik" ;
30+ import { useAppSelector } from '@/lib/hooks' ;
31+ import { RootState } from '@/lib/store' ;
3532
3633
3734
@@ -70,12 +67,8 @@ const InvitationsList = (): React.JSX.Element => {
7067 const [ errorMessage , setErrorMessage ] = useState ( "" ) ;
7168 const [ showAlert , setShowAlert ] = useState ( false ) ;
7269 const [ message , setMessage ] = useState ( '' )
73- const sessionId = useAppSelector ( ( state ) => state . session . sessionId ) ;
7470
75-
76- const accessToken = useAppSelector (
77- ( state ) => state . session . token
78- ) ;
71+ const ecosystemEnabled = useAppSelector ( ( state : RootState ) => state . ecosystem ?. ecosystemEnableStatus )
7972
8073 const [ paginationParameter , setPaginationParameter ] = useState < PageParameter > (
8174 {
@@ -93,7 +86,6 @@ const InvitationsList = (): React.JSX.Element => {
9386 }
9487 ) ;
9588
96- const redirectUrl = `${ process . env . NEXT_PUBLIC_CLIENT_URL } /dashboard` ;
9789
9890 const validationSchema = Yup . object ( ) . shape ( {
9991 email : Yup . string ( )
@@ -301,13 +293,15 @@ const InvitationsList = (): React.JSX.Element => {
301293 className = { `h-5 w-5 ${ tableLoading ? "animate-spin" : "" } ` }
302294 />
303295 </ Button >
304- < Button
305- onClick = { showInvitationPopUp }
306- className = "flex items-center gap-2 px-4 py-2 text-base font-medium"
307- disabled = { loading }
308- >
309- Create Ecosystem Lead
310- </ Button >
296+ { ecosystemEnabled &&
297+ < Button
298+ onClick = { showInvitationPopUp }
299+ className = "flex items-center gap-2 px-4 py-2 text-base font-medium"
300+ disabled = { loading }
301+ >
302+ Create Ecosystem Lead
303+ </ Button >
304+ }
311305 </ div >
312306 </ div >
313307 < div className = "relative min-h-[400px]" >
0 commit comments