/** * StaffUsers.jsx — Staff User Management * Read-only view of staff users from the Entra portal. * Users are added directly via Entra Portal → Users → New User. * This panel shows who currently has access and their session activity. */ import React, { useState, useEffect, useCallback } from 'react'; import { useAdmin } from '../../context/AdminContext'; export default function StaffUsers() { const { apiCall } = useAdmin(); const [users, setUsers] = useState([]); const [loading, setLoading] = useState(true); const [error, setError] = useState(null); const loadUsers = useCallback(async () => { setLoading(true); const result = await apiCall('/api/admin/users'); if (result?.ok) setUsers(result.data ?? result.users ?? []); else setError('Failed to load users.'); setLoading(false); }, [apiCall]); useEffect(() => { loadUsers(); }, [loadUsers]); return (
| Name | Role | Status | |
|---|---|---|---|
| No users found. | |||
| {u.name ?? u.clientName ?? '—'} | {u.email ?? u.userEmail ?? '—'} | {u.role ?? 'Staff'} | Active |
To add a new staff user: Entra Portal → Users → New User, then assign them to the Staff app registration.
To remove access: Entra Portal → Users → select user → Delete or revoke the app assignment.