mirror of
https://github.com/QuivrHQ/quivr.git
synced 2024-12-17 19:32:47 +03:00
9be4a57979
Issues: https://github.com/StanGirard/quivr/issues/1497 https://github.com/StanGirard/quivr/issues/1495 https://github.com/StanGirard/quivr/issues/1506 1. feat(chatInput): increase upload button size 2. feat(brains-library): add Spinner on loading 3. feat: improve logout ux ![Screenshot 2023-10-30 at 11 48 58](https://github.com/StanGirard/quivr/assets/63923024/fb8e0848-b349-4fbd-a7a5-ff43a73ae364) https://github.com/StanGirard/quivr/assets/63923024/cbd7cd42-e58a-49fb-9867-97f19dde9270 https://github.com/StanGirard/quivr/assets/63923024/a69b6b28-1c19-43e7-a02b-1df215a34a2e
45 lines
1.4 KiB
TypeScript
45 lines
1.4 KiB
TypeScript
"use client";
|
|
|
|
import { useTranslation } from "react-i18next";
|
|
|
|
import Field from "@/lib/components/ui/Field";
|
|
import Spinner from "@/lib/components/ui/Spinner";
|
|
|
|
import { PublicBrainItem } from "./components/PublicBrainItem/PublicBrainItem";
|
|
import { useBrainsLibrary } from "./hooks/useBrainsLibrary";
|
|
|
|
const BrainsLibrary = (): JSX.Element => {
|
|
const { displayingPublicBrains, searchBarText, setSearchBarText, isLoading } =
|
|
useBrainsLibrary();
|
|
const { t } = useTranslation("brain");
|
|
|
|
return (
|
|
<div className="flex flex-1 flex-col items-center">
|
|
<div className="flex">
|
|
<Field
|
|
value={searchBarText}
|
|
onChange={(e) => setSearchBarText(e.target.value)}
|
|
name="search"
|
|
inputClassName="w-max lg:min-w-[300px] md:min-w-[200px] min-w-[100px] mt-10 rounded-3xl bg-white lg:mb-5"
|
|
placeholder={t("public_brains_search_bar_placeholder")}
|
|
/>
|
|
</div>
|
|
{isLoading && (
|
|
<div className="flex justify-center items-center flex-1">
|
|
<Spinner className="text-4xl" />
|
|
</div>
|
|
)}
|
|
|
|
<div className="flex flex-wrap justify-stretch w-full">
|
|
{displayingPublicBrains.map((brain) => (
|
|
<div key={brain.id} className="lg:w-1/3 md:w-1/2 md:p-5 p-5 w-full">
|
|
<PublicBrainItem brain={brain} />
|
|
</div>
|
|
))}
|
|
</div>
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default BrainsLibrary;
|