Dashboard und Benutzerverwaltung
This commit is contained in:
parent
c4d27a1187
commit
4cf671e32d
16 changed files with 684 additions and 79 deletions
21
frontend/athena/components/UserCounter.tsx
Normal file
21
frontend/athena/components/UserCounter.tsx
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
"use client";
|
||||
|
||||
import { useEffect, useState } from "react";
|
||||
import { api } from "@/lib/api";
|
||||
|
||||
export default function UserCounter() {
|
||||
|
||||
const [count, setCount] = useState(0);
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
api.get("/users")
|
||||
.then(res => setCount(res.data.length))
|
||||
.catch(console.error);
|
||||
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<>{count}</>
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue