import { getRecentActivity } from "../../api/admin";
import { useEffect, useState } from "react";

export function useRecentActivity() {
    const [logs, setLogs] = useState([]);

    const fetchRecentActivity = async () => {
        return await getRecentActivity();
    }

    useEffect(() => {
        fetchRecentActivity()
            .then(setLogs);
    }, []);

    return logs;
}