+ {section.label && (
+ <>
+ {sIdx > 0 &&
}
+
0 ? 4 : 0}>
+ {section.label}
+
+ >
+ )}
+ {section.items.map((item: any) =>
+ item.children ? (
navigate(child.path)}
+ key={item.label}
+ label={item.label}
+ leftSection={}
+ defaultOpened={item.children.some((c: any) =>
+ location.pathname.startsWith(c.path),
+ )}
+ >
+ {item.children.map((child: any) => (
+ navigate(child.path)}
+ />
+ ))}
+
+ ) : (
+ }
+ active={location.pathname === item.path}
+ onClick={() => navigate(item.path!)}
/>
- ))}
-
- ) : (
-
}
- active={location.pathname === item.path}
- onClick={() => navigate(item.path!)}
- />
- ),
- )}
+ ),
+ )}
+
+ ))}
{user?.isSuperadmin && (
<>
diff --git a/frontend/src/pages/admin/AdminPage.tsx b/frontend/src/pages/admin/AdminPage.tsx
index 2f386ea..07e28ae 100644
--- a/frontend/src/pages/admin/AdminPage.tsx
+++ b/frontend/src/pages/admin/AdminPage.tsx
@@ -1,11 +1,14 @@
import { useState } from 'react';
import {
Title, Text, Card, Table, SimpleGrid, Group, Stack, Badge, Loader, Center,
- ThemeIcon, Tabs, ActionIcon, Switch, TextInput, Avatar,
+ ThemeIcon, Tabs, Switch, TextInput, Avatar, Modal, Button, PasswordInput,
+ Select, NumberInput, Menu, Divider,
} from '@mantine/core';
+import { useDisclosure } from '@mantine/hooks';
import {
IconUsers, IconBuilding, IconShieldLock, IconSearch,
- IconCrown, IconUser,
+ IconCrown, IconPlus, IconArchive, IconChevronDown,
+ IconCircleCheck, IconBan, IconArchiveOff,
} from '@tabler/icons-react';
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';
import api from '../../services/api';
@@ -19,10 +22,61 @@ interface AdminUser {
interface AdminOrg {
id: string; name: string; schema_name: string; status: string;
email: string; phone: string; member_count: string; created_at: string;
+ contract_number: string; plan_level: string;
}
+interface CreateTenantForm {
+ orgName: string;
+ email: string;
+ phone: string;
+ addressLine1: string;
+ city: string;
+ state: string;
+ zipCode: string;
+ contractNumber: string;
+ planLevel: string;
+ fiscalYearStartMonth: number | '';
+ adminEmail: string;
+ adminPassword: string;
+ adminFirstName: string;
+ adminLastName: string;
+}
+
+const initialFormState: CreateTenantForm = {
+ orgName: '',
+ email: '',
+ phone: '',
+ addressLine1: '',
+ city: '',
+ state: '',
+ zipCode: '',
+ contractNumber: '',
+ planLevel: 'standard',
+ fiscalYearStartMonth: 1,
+ adminEmail: '',
+ adminPassword: '',
+ adminFirstName: '',
+ adminLastName: '',
+};
+
+const planBadgeColor: Record