import React, { useEffect, useState } from 'react'; import http from '@/api/http'; import { User } from '@/api/admin/user'; import { AdminTransformers } from '@/api/admin/transformers'; import { Dropdown } from '@/components/elements/dropdown'; import { BanIcon, DotsVerticalIcon, LockOpenIcon, PencilIcon, PlusIcon, SupportIcon, TrashIcon, } from '@heroicons/react/solid'; import { Button } from '@/components/elements/button/index'; import { Dialog } from '@/components/elements/dialog'; import { Checkbox } from '@/components/elements/inputs'; const UsersContainerV2 = () => { const [ users, setUsers ] = useState([]); useEffect(() => { document.title = 'Admin | Users'; }, []); const [ visible, setVisible ] = useState(false); useEffect(() => { http.get('/api/application/users') .then(({ data }) => { setUsers(data.data.map(AdminTransformers.toUser)); }) .catch(console.error); }, []); return (
setVisible(false)}> This account will be permanently deleted. setVisible(false)} >Cancel Delete {users.map(user => ( ))}
Email
{'User

{user.email}

{user.uuid}

{user.isUsingTwoFactor && 2-FA Enabled } }>Edit }>Reset Password } disabled={!user.isUsingTwoFactor}> Disable 2-FA }>Suspend } onClick={() => setVisible(true)} danger>Delete Account
); }; export default UsersContainerV2;