"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}</>
    );
}