quivr/frontend/app/chat/[chatId]/components/ActionsBar/hooks/useActionBar.ts
Mamadou DICKO ef78dec810
feat: improve knowledge feed process ux (#1274)
* style(deleteBrainModal): reduce buttons space

* refactor: add KnowledgeToFeedInput

* feat: update translations

* feat: update knowledge feed component

* style: reduce knowledge to upload displayer size

* feat: move KnowledgeToFeedInput to @lib

* refactor: rename useSelectedChatPage to useChatNotificationsSync

* feat: change chatPage bg to gray when feed card is opened

* style: change feed process submit button bg to purple
2023-09-27 15:39:04 +02:00

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,
};
};