mirror of
https://github.com/StanGirard/quivr.git
synced 2024-12-24 03:41:56 +03:00
10af0c949a
* feat: rename ChatMessages to MessagesDialog * feat: rename history to messages * feat: add notifications to ChatContext * feat: add getNotificationsFromChatHistory * feat: add getMergedChatHistoryWithReducedNotifications * refactor: update useActionBar * refactor: update <ChatMessage />-n * feat: update crawler and endpoint notifications content * feat: display notifications * test: update <MessageDialog /> tests * feat: rename ChatMessage to QADisplay * feat: rename ChatHistory to ChatMessage * feat(upload): throw error when file missing * feat: rename getMergedChatHistoryWithReducedNotifications to getMergedChatMessagesWithReducedNotifications * feat: change history wording to message * feat: move getFileIcon to lib * refactor(NotificationDisplayer): move types to types.ts * chore: improve ux * feat: rename MessagesDialog to ChatDialogue
30 lines
802 B
TypeScript
30 lines
802 B
TypeScript
import { useTranslation } from "react-i18next";
|
|
|
|
import { useChatContext } from "@/lib/context";
|
|
|
|
export const ChatHeader = (): JSX.Element => {
|
|
const { t } = useTranslation(["chat"]);
|
|
const { messages } = useChatContext();
|
|
|
|
if (messages.length !== 0) {
|
|
return (
|
|
<h1 className="text-3xl font-bold text-center">
|
|
{t("chat_title_intro")}{" "}
|
|
<span className="text-purple-500">{t("brains")}</span>
|
|
</h1>
|
|
);
|
|
}
|
|
|
|
return (
|
|
<h1 className="text-3xl font-bold text-center">
|
|
{t("chat_title_intro")}{" "}
|
|
<span className="text-purple-500">{t("brains")}</span>
|
|
{" !! "}
|
|
<br />
|
|
{t("empty_brain_title_prefix")}{" "}
|
|
<span className="text-purple-500">{t("brain")}</span>{" "}
|
|
{t("empty_brain_title_suffix")}
|
|
</h1>
|
|
);
|
|
};
|