From 84b45cd6b11347e66437cd92dc20372d0abd6eb9 Mon Sep 17 00:00:00 2001
From: Joseph Ditton <jditton.atomic@gmail.com>
Date: Wed, 1 Dec 2021 20:18:26 -0700
Subject: adds roles

---
 client/components/admin/_admin.jsx | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
 create mode 100644 client/components/admin/_admin.jsx

(limited to 'client/components/admin/_admin.jsx')

diff --git a/client/components/admin/_admin.jsx b/client/components/admin/_admin.jsx
new file mode 100644
index 0000000..aff544c
--- /dev/null
+++ b/client/components/admin/_admin.jsx
@@ -0,0 +1,21 @@
+import { useState, useContext, useEffect } from 'react';
+import { ApiContext } from '../../utils/api_context';
+
+export const Admin = () => {
+  const [users, setUsers] = useState([]);
+  const api = useContext(ApiContext);
+
+  useEffect(async () => {
+    const { users } = await api.get('/users');
+    setUsers(users);
+  }, []);
+
+  return (
+    <div className="p-4">
+      <h2 className="text-3xl">Users</h2>
+      {users.map((user) => (
+        <div>{user.name}</div>
+      ))}
+    </div>
+  );
+};
-- 
cgit v1.2.3-70-g09d2

