mirror of
https://github.com/QuivrHQ/quivr.git
synced 2024-12-18 03:41:44 +03:00
b0514d6149
* add libraries for traslation purposes * Add button and service for language selection * add spanish translation on login page * add spanish translation on upload page * Add spanish translations for explore page * Add translations on user page * Add translations for config page * Add spanish translations on chat page * add translations for brain page * fix GUI and save on local storage * fix (i18n) init and types * fix (i18n): typos * add translation on new brain modal * add translations on metadata * Add translations on home page * fixes types * fix(frontend-tests): use get by id instead of text --------- Co-authored-by: Gustavo Maciel <gustavo_m13@outlook.com>
36 lines
949 B
TypeScript
36 lines
949 B
TypeScript
import { UUID } from "crypto";
|
|
import { useTranslation } from "react-i18next";
|
|
|
|
import { BrainUser } from "./components";
|
|
import { useBrainUsers } from "./hooks/useBrainUsers";
|
|
|
|
type BrainUsersProps = {
|
|
brainId: UUID;
|
|
};
|
|
export const BrainUsers = ({ brainId }: BrainUsersProps): JSX.Element => {
|
|
const { t } = useTranslation(["translation","config"]);
|
|
const { brainUsers, fetchBrainUsers, isFetchingBrainUsers } =
|
|
useBrainUsers(brainId);
|
|
if (isFetchingBrainUsers) {
|
|
return <p className="text-gray-500">{t("loading")}</p>;
|
|
}
|
|
|
|
if (brainUsers.length === 0) {
|
|
return <p className="text-gray-500">{t("noUser",{ns:'config'})}</p>;
|
|
}
|
|
|
|
return (
|
|
<>
|
|
{brainUsers.map((subscription) => (
|
|
<BrainUser
|
|
key={subscription.email}
|
|
email={subscription.email}
|
|
role={subscription.role}
|
|
brainId={brainId}
|
|
fetchBrainUsers={fetchBrainUsers}
|
|
/>
|
|
))}
|
|
</>
|
|
);
|
|
};
|