@@ -8,6 +8,7 @@ import InviteUserForm from "@/components/InviteUserForm";
88import ConfirmationModal from "@/components/AccountManagement/ConfirmationModal" ;
99import EditModal from "@/components/AccountManagement/EditModal" ;
1010import { useApiClient } from "@/hooks/useApiClient" ;
11+ import { useFetch } from "@/hooks/useFetch" ;
1112import { isStaff , formatUserType } from "@/lib/userUtils" ;
1213import AccountDropdown from "@/components/AccountManagement/AccountDropdown" ;
1314import AccountStatusTag from "@/components/tags/AccountStatusTag" ;
@@ -51,6 +52,9 @@ function getStatusLabel(user: AccountUserResponse) {
5152export default function AccountManagementPage ( ) {
5253 const tableRef = useRef < AdvancedBaseTableHandle < AccountRow > > ( null ) ;
5354 const { apiClient } = useApiClient ( ) ;
55+ const { data : tags , refetch : refetchTags } = useFetch < string [ ] > (
56+ "/api/users/tags"
57+ ) ;
5458
5559 const [ isInviteModalOpen , setInviteModalOpen ] = useState ( false ) ;
5660
@@ -134,6 +138,7 @@ export default function AccountManagementPage() {
134138
135139 tableRef . current ?. upsertItem ( nextUser ) ;
136140 setSelectedUser ( nextUser ) ;
141+ refetchTags ( ) ;
137142 } catch ( error ) {
138143 console . error ( "Error updating user:" , error ) ;
139144 }
@@ -198,7 +203,8 @@ export default function AccountManagementPage() {
198203 } ,
199204 {
200205 id : "tag" ,
201- filterType : "string" ,
206+ filterType : "enum" ,
207+ filterOptions : tags ?? [ ] ,
202208 cell : ( item ) =>
203209 item . tag ? (
204210 < span className = "px-3 py-1 bg-red-primary/70 text-white rounded-md text-sm" >
@@ -334,6 +340,7 @@ This will restore the user's access to the system.`
334340 selectedUserId = {
335341 selectedUser && ! selectedUser . pending ? selectedUser . id : undefined
336342 }
343+ existingTags = { tags ?? [ ] }
337344 />
338345 </ >
339346 ) ;
0 commit comments