feat(feedBrain): add manage button (#1674)

Demo:

![Screenshot 2023-11-20 at 17 57
45](https://github.com/StanGirard/quivr/assets/63923024/abdd89ae-7c0c-421e-b716-9d7d3eb98c1f)
![Screenshot 2023-11-20 at 17 57
32](https://github.com/StanGirard/quivr/assets/63923024/3ef096ee-668b-4e25-85eb-60aa60e56038)
This commit is contained in:
Mamadou DICKO 2023-11-21 09:33:07 +01:00 committed by GitHub
parent d902e78ffa
commit 09fe076134
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 21 additions and 7 deletions

View File

@ -1,3 +1,4 @@
import Link from "next/link";
import { useMemo } from "react"; import { useMemo } from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { MdClose } from "react-icons/md"; import { MdClose } from "react-icons/md";
@ -22,7 +23,7 @@ export const KnowledgeToFeed = ({
}: KnowledgeToFeedProps): JSX.Element => { }: KnowledgeToFeedProps): JSX.Element => {
const { allBrains, currentBrainId, setCurrentBrainId } = useBrainContext(); const { allBrains, currentBrainId, setCurrentBrainId } = useBrainContext();
const { t } = useTranslation(["upload"]); const { t } = useTranslation(["upload", "brain"]);
const { setShouldDisplayFeedCard } = useKnowledgeToFeedContext(); const { setShouldDisplayFeedCard } = useKnowledgeToFeedContext();
const { currentBrainDetails } = useBrainContext(); const { currentBrainDetails } = useBrainContext();
@ -70,6 +71,13 @@ export const KnowledgeToFeed = ({
) : ( ) : (
<KnowledgeToFeedInput feedBrain={() => void feedBrain()} /> <KnowledgeToFeedInput feedBrain={() => void feedBrain()} />
)} )}
{Boolean(currentBrainId) && (
<Link href={`brains-management/${currentBrainId ?? ""}`}>
<Button variant={"tertiary"}>
{t("manage_brain", { ns: "brain" })}
</Button>
</Link>
)}
</div> </div>
); );
}; };

View File

@ -61,5 +61,6 @@
"update_secrets_message":"Enter your secret. This information is required to identify you when calling the API", "update_secrets_message":"Enter your secret. This information is required to identify you when calling the API",
"update_secrets_button":"Update secrets", "update_secrets_button":"Update secrets",
"secrets_updated":"Secrets updated", "secrets_updated":"Secrets updated",
"secrets_update_error":"Error while updating secrets" "secrets_update_error":"Error while updating secrets",
"manage_brain": "Manage brain"
} }

View File

@ -61,5 +61,6 @@
"update_secrets_message": "Ingrese su contraseña. Esta información es necesaria para identificarlo al llamar a la API", "update_secrets_message": "Ingrese su contraseña. Esta información es necesaria para identificarlo al llamar a la API",
"update_secrets_button": "Actualizar secretos", "update_secrets_button": "Actualizar secretos",
"secrets_updated": "Secretos actualizados", "secrets_updated": "Secretos actualizados",
"secrets_update_error": "Error al actualizar secretos" "secrets_update_error": "Error al actualizar secretos",
"manage_brain": "Gestionar cerebro"
} }

View File

@ -61,5 +61,6 @@
"update_secrets_message": "Entrez votre mot de passe. Ces informations sont nécessaires pour vous identifier lors de l'appel de l'API", "update_secrets_message": "Entrez votre mot de passe. Ces informations sont nécessaires pour vous identifier lors de l'appel de l'API",
"update_secrets_button": "Mettre à jour les secrets", "update_secrets_button": "Mettre à jour les secrets",
"secrets_updated": "Secrets mis à jour", "secrets_updated": "Secrets mis à jour",
"secrets_update_error": "Erreur lors de la mise à jour des secrets" "secrets_update_error": "Erreur lors de la mise à jour des secrets",
"manage_brain": "Gérer le cerveau"
} }

View File

@ -61,5 +61,6 @@
"update_secrets_message": "Digite seu segredo. Essa informação é necessária para identificá-lo ao chamar a API", "update_secrets_message": "Digite seu segredo. Essa informação é necessária para identificá-lo ao chamar a API",
"update_secrets_button": "Atualizar segredos", "update_secrets_button": "Atualizar segredos",
"secrets_updated": "Segredos atualizados", "secrets_updated": "Segredos atualizados",
"secrets_update_error": "Erro ao atualizar segredos" "secrets_update_error": "Erro ao atualizar segredos",
"manage_brain": "Gerenciar cérebro"
} }

View File

@ -61,5 +61,6 @@
"update_secrets_message": "Введите свой пароль. Эта информация необходима для идентификации вас при вызове API", "update_secrets_message": "Введите свой пароль. Эта информация необходима для идентификации вас при вызове API",
"update_secrets_button": "Обновить секреты", "update_secrets_button": "Обновить секреты",
"secrets_updated": "Секреты обновлены", "secrets_updated": "Секреты обновлены",
"secrets_update_error": "Ошибка при обновлении секретов" "secrets_update_error": "Ошибка при обновлении секретов",
"manage_brain": "Управление мозгом"
} }

View File

@ -61,5 +61,6 @@
"update_secrets_message": "输入您的秘密。在调用API时此信息是必需的以识别您", "update_secrets_message": "输入您的秘密。在调用API时此信息是必需的以识别您",
"update_secrets_button": "更新秘密", "update_secrets_button": "更新秘密",
"secrets_updated": "秘密已更新", "secrets_updated": "秘密已更新",
"secrets_update_error": "更新秘密时出错" "secrets_update_error": "更新秘密时出错",
"manage_brain": "管理大脑"
} }