mirror of
https://github.com/StanGirard/quivr.git
synced 2024-12-17 23:51:51 +03:00
36fd146fed
* style: make FeedItemIcon the same size * feat: update feed component brain selector label position * style: change purple to 600 * feat: improve already dropped file message ux * feat: autoclose feedinput on chatId change * style: change chat colors * feat: prevent linebreak in knowledge to upload row * feat(textFIeld): avoid textfield content going under icon * feat(knowledgeToUpload): add tooltip on urls and files name * feat(feedBrain): auto scroll on messages when feed modal get opened * style: update colors * refactor: rename uploadCard to FeedCard
39 lines
1.0 KiB
TypeScript
39 lines
1.0 KiB
TypeScript
"use client";
|
|
|
|
import { createContext, useState } from "react";
|
|
|
|
import { FeedItemType } from "@/app/chat/[chatId]/components/ActionsBar/types";
|
|
|
|
type KnowledgeToFeedContextType = {
|
|
knowledgeToFeed: FeedItemType[];
|
|
setKnowledgeToFeed: React.Dispatch<React.SetStateAction<FeedItemType[]>>;
|
|
shouldDisplayFeedCard: boolean;
|
|
setShouldDisplayFeedCard: React.Dispatch<React.SetStateAction<boolean>>;
|
|
};
|
|
|
|
export const KnowledgeToFeedContext = createContext<
|
|
KnowledgeToFeedContextType | undefined
|
|
>(undefined);
|
|
|
|
export const KnowledgeToFeedProvider = ({
|
|
children,
|
|
}: {
|
|
children: React.ReactNode;
|
|
}): JSX.Element => {
|
|
const [knowledgeToFeed, setKnowledgeToFeed] = useState<FeedItemType[]>([]);
|
|
const [shouldDisplayFeedCard, setShouldDisplayFeedCard] = useState(false);
|
|
|
|
return (
|
|
<KnowledgeToFeedContext.Provider
|
|
value={{
|
|
knowledgeToFeed,
|
|
setKnowledgeToFeed,
|
|
shouldDisplayFeedCard,
|
|
setShouldDisplayFeedCard,
|
|
}}
|
|
>
|
|
{children}
|
|
</KnowledgeToFeedContext.Provider>
|
|
);
|
|
};
|