Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
Update frontend/src/pages/SuperAdminPanel.jsx
Browse files
frontend/src/pages/SuperAdminPanel.jsx
CHANGED
|
@@ -125,8 +125,21 @@ const SuperAdminPanel = () => {
|
|
| 125 |
const [users, setUsers] = useState([]);
|
| 126 |
const [demoBookings, setDemoBookings] = useState([]);
|
| 127 |
const [emailLogs, setEmailLogs] = useState([]);
|
| 128 |
-
const [
|
| 129 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 130 |
|
| 131 |
const [sortOrgCol, setSortOrgCol] = useState('Tenant Name');
|
| 132 |
const [sortOrgDir, setSortOrgDir] = useState('asc');
|
|
|
|
| 125 |
const [users, setUsers] = useState([]);
|
| 126 |
const [demoBookings, setDemoBookings] = useState([]);
|
| 127 |
const [emailLogs, setEmailLogs] = useState([]);
|
| 128 |
+
const [activeTab, setActiveTab] = useState(() => {
|
| 129 |
+
const params = new URLSearchParams(window.location.search);
|
| 130 |
+
const tabFromUrl = params.get('tab');
|
| 131 |
+
const storedTab = localStorage.getItem('superAdminActiveTab');
|
| 132 |
+
return tabFromUrl || storedTab || 'overview';
|
| 133 |
+
});
|
| 134 |
+
|
| 135 |
+
useEffect(() => {
|
| 136 |
+
localStorage.setItem('superAdminActiveTab', activeTab);
|
| 137 |
+
const url = new URL(window.location.href);
|
| 138 |
+
if (url.searchParams.get('tab') !== activeTab) {
|
| 139 |
+
url.searchParams.set('tab', activeTab);
|
| 140 |
+
window.history.replaceState({}, '', url.toString());
|
| 141 |
+
}
|
| 142 |
+
}, [activeTab]);
|
| 143 |
|
| 144 |
const [sortOrgCol, setSortOrgCol] = useState('Tenant Name');
|
| 145 |
const [sortOrgDir, setSortOrgDir] = useState('asc');
|