import React, { useEffect, useState } from 'react'; import http from '@/api/http'; import { Transformers, User } from '@definitions/admin'; import { LockOpenIcon, PlusIcon, SupportIcon, TrashIcon } from '@heroicons/react/solid'; import { Button } from '@/components/elements/button/index'; import { Checkbox, InputField } from '@/components/elements/inputs'; import UserTableRow from '@/components/admin/users/UserTableRow'; const UsersContainerV2 = () => { const [ users, setUsers ] = useState([]); useEffect(() => { document.title = 'Admin | Users'; }, []); useEffect(() => { http.get('/api/application/users') .then(({ data }) => { setUsers(data.data.map(Transformers.toUser)); }) .catch(console.error); }, []); return (
{users.map(user => )}
Email
); }; export default UsersContainerV2;