mirror of
https://github.com/QuivrHQ/quivr.git
synced 2024-12-16 18:52:12 +03:00
9eb6120c6f
Issue: https://github.com/StanGirard/quivr/issues/1881 Demo: https://github.com/StanGirard/quivr/assets/63923024/348c7b17-84ca-46a3-89e3-3a00a621af69
21 lines
588 B
TypeScript
21 lines
588 B
TypeScript
import { useEffect, useState } from "react";
|
|
|
|
import { useChatContext } from "@/lib/context";
|
|
|
|
import { checkIfHasPendingRequest } from "../utils/checkIfHasPendingRequest";
|
|
|
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
export const useActionBar = () => {
|
|
const [hasPendingRequests, setHasPendingRequests] = useState(false);
|
|
const { notifications } = useChatContext();
|
|
|
|
useEffect(() => {
|
|
setHasPendingRequests(checkIfHasPendingRequest(notifications));
|
|
}, [notifications]);
|
|
|
|
return {
|
|
hasPendingRequests,
|
|
setHasPendingRequests,
|
|
};
|
|
};
|