quivr/frontend/app/brains-management/library/page.tsx
Mamadou DICKO 2c9a0c1ed2
feat: activate public brain subscription (#1241)
* feat: add public brain details modal

* feat(brain): add subscription route

* feat: activate subscription button

* feat: add last_update column to brain table

* feat: display last update on public brain details page

* feat: change RBAC rule for public brains

* feat: maintain brain last_update time
2023-09-22 11:44:09 +02:00

39 lines
1.2 KiB
TypeScript

"use client";
import { useTranslation } from "react-i18next";
import Field from "@/lib/components/ui/Field";
import { PublicBrainItem } from "./components/PublicBrainItem/PublicBrainItem";
import { useBrainsLibrary } from "./hooks/useBrainsLibrary";
const BrainsLibrary = (): JSX.Element => {
const { displayingPublicBrains, searchBarText, setSearchBarText } =
useBrainsLibrary();
const { t } = useTranslation("brain");
return (
<div className="flex flex-1 flex-col items-center m-20 border-2 border-gray-100 border-solid rounded-xl">
<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"
placeholder={t("public_brains_search_bar_placeholder")}
/>
</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 w-1 md:p-5">
<PublicBrainItem brain={brain} />
</div>
))}
</div>
</div>
);
};
export default BrainsLibrary;