Addressing review comments

This commit is contained in:
Keith Stevens
2023-01-07 19:43:10 +09:00
parent b70c638f7c
commit 8f459d9aae
2 changed files with 2 additions and 22 deletions
+1 -3
View File
@@ -10,9 +10,7 @@ const UsersCell = () => {
// Fetch and save the users.
const [users, setUsers] = useState([]);
const { isLoading } = useSWR("/api/admin/users", fetcher, {
onSuccess: (data) => {
setUsers(data);
},
onSuccess: setUsers,
});
// Present users in a naive table.
+1 -19
View File
@@ -28,22 +28,6 @@ const AdminIndex = () => {
router.push("/");
}, [session, status]);
// While loading, just show something.
if (status === "loading") {
return (
<>
<Head>
<title>Open Assistant</title>
<meta
name="description"
content="Conversational AI for everyone. An open source project to create a chat enabled GPT LLM run by LAION and contributors around the world."
/>
</Head>
<main className="oa-basic-theme">loading...</main>
</>
);
}
// Show the final page.
// TODO(#237): Display a component that fetches actual user data.
return (
@@ -55,9 +39,7 @@ const AdminIndex = () => {
content="Conversational AI for everyone. An open source project to create a chat enabled GPT LLM run by LAION and contributors around the world."
/>
</Head>
<main className="oa-basic-theme">
<UsersCell />
</main>
<main className="oa-basic-theme">{status === "loading" ? "loading..." : <UsersCell />}</main>
</>
);
};