@@ -75,49 +123,65 @@ const handleNewTenant =()=>{
]}
/>
-
-
-
- setSearchText(e.target.value)}
- className="form-control form-control-sm"
- placeholder="Search Tenant"
- />
-
+ {/* Super Tenant Actions */}
+ {isSuperTenant && (
+
+
+ {/* Search */}
+
+ setSearchText(e.target.value)}
+ className="form-control form-control-sm"
+ placeholder="Search Tenant"
+ />
+
-
-
refetchFn && refetchFn()}>
- Refresh
-
+ {/* Actions */}
+
+ refetchFn && refetchFn()}
+ >
+ Refresh{" "}
+
+
- {IsSupperTenant && (
- )}
+ type="button"
+ title="Add New Tenant"
+ className="p-1 bg-primary rounded-circle cursor-pointer"
+ onClick={handleNewTenant}
+ >
+
+
+
-
- {IsViewTenant ? (
):(
-
-
-
Access Denied: You don't have permission to perform this action. !
-
- ) }
-
+ )}
+
+ {/* Tenant List or Access Denied */}
+ {isSuperTenant ? (
+
+ ) : !isSelfTenant ? (
+
+
+
+ Access Denied: You don't have permission to perform this action!
+
+
+ ) : null}
);
diff --git a/src/router/AppRoutes.jsx b/src/router/AppRoutes.jsx
index d46f397f..0e269a6f 100644
--- a/src/router/AppRoutes.jsx
+++ b/src/router/AppRoutes.jsx
@@ -42,18 +42,20 @@ import TenantPage from "../pages/Tenant/TenantPage";
import CreateTenant from "../pages/Tenant/CreateTenant";
import ExpensePage from "../pages/Expense/ExpensePage";
import TenantDetails from "../pages/Tenant/TenantDetails";
+import SelfTenantDetails from "../pages/Tenant/SelfTenantDetails";
+import SuperTenantDetails from "../pages/Tenant/SuperTenantDetails";
const router = createBrowserRouter(
[
{
element:
,
children: [
- {path: "/auth/login", element:
},
- {path: "/auth/login-otp", element:
},
+ { path: "/auth/login", element:
},
+ { path: "/auth/login-otp", element:
},
{ path: "/auth/reqest/demo", element:
},
{ path: "/auth/forgot-password", element:
},
{ path: "/reset-password", element:
},
- { path: "/legal-info", element:
},
+ { path: "/legal-info", element:
},
{ path: "/auth/changepassword", element:
},
],
},
@@ -82,9 +84,10 @@ const router = createBrowserRouter(
{ path: "/gallary", element:
},
{ path: "/expenses", element:
},
{ path: "/masters", element:
},
- { path: "/tenants", element:
},
- { path: "/tenants/new-tenant", element:
},
- { path: "/tenant/:tenantId", element:
},
+ { path: "/tenants", element:
},
+ { path: "/tenants/new-tenant", element:
},
+ { path: "/tenant/:tenantId", element:
},
+ { path: "/tenant/self", element:
},
{ path: "/help/support", element:
},
{ path: "/help/docs", element:
},
{ path: "/help/connect", element:
},
diff --git a/src/utils/constants.jsx b/src/utils/constants.jsx
index be70ca85..555e3a0b 100644
--- a/src/utils/constants.jsx
+++ b/src/utils/constants.jsx
@@ -96,10 +96,10 @@ export const reference = [
{ val: "root tenant", name: "Root Tenant" },
];
export const orgSize = [
- { val: "50", name: "1-50" },
- { val: "100", name: "51-100" },
- { val: "500", name: "101-500" },
- { val: "600", name: "500+" },
+ { val: "1-50", name: "1-50" },
+ { val: "51-100", name: "51-100" },
+ { val: "101-500", name: "101-500" },
+ { val: "500+", name: "500+" },
];
export const BASE_URL = process.env.VITE_BASE_URL;