import { useState } from "react"; import { useTranslation } from "react-i18next"; import { KnowledgeToFeed } from "@/app/chat/[chatId]/components/ActionsBar/components"; import { useBrainContext } from "@/lib/context/BrainProvider/hooks/useBrainContext"; import { useKnowledgeToFeedContext } from "@/lib/context/KnowledgeToFeedProvider/hooks/useKnowledgeToFeedContext"; import styles from "./UploadDocumentModal.module.scss"; import { useAddKnowledge } from "./hooks/useAddKnowledge"; import { Modal } from "../ui/Modal/Modal"; import { QuivrButton } from "../ui/QuivrButton/QuivrButton"; export const UploadDocumentModal = (): JSX.Element => { const { shouldDisplayFeedCard, setShouldDisplayFeedCard, knowledgeToFeed } = useKnowledgeToFeedContext(); const { currentBrain } = useBrainContext(); const { feedBrain } = useAddKnowledge(); const [feeding, setFeeding] = useState(false); useKnowledgeToFeedContext(); const { t } = useTranslation(["knowledge"]); const handleFeedBrain = async () => { setFeeding(true); await feedBrain(); setFeeding(false); setShouldDisplayFeedCard(false); }; if (!shouldDisplayFeedCard) { return <>; } return ( } >
); };