mirror of
https://github.com/QuivrHQ/quivr.git
synced 2024-12-15 17:43:03 +03:00
a540a201e3
# Description Please include a summary of the changes and the related issue. Please also include relevant motivation and context. ## Checklist before requesting a review Please delete options that are not relevant. - [ ] My code follows the style guidelines of this project - [ ] I have performed a self-review of my code - [ ] I have commented hard-to-understand areas - [ ] I have ideally added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] Any dependent changes have been merged ## Screenshots (if appropriate):
69 lines
2.1 KiB
TypeScript
69 lines
2.1 KiB
TypeScript
"use client";
|
|
|
|
import { useState } from "react";
|
|
|
|
import { AddBrainModal } from "@/lib/components/AddBrainModal";
|
|
import { useBrainCreationContext } from "@/lib/components/AddBrainModal/components/AddBrainSteps/brainCreation-provider";
|
|
import PageHeader from "@/lib/components/PageHeader/PageHeader";
|
|
import { UploadDocumentModal } from "@/lib/components/UploadDocumentModal/UploadDocumentModal";
|
|
import { Tabs } from "@/lib/components/ui/Tabs/Tabs";
|
|
import { useKnowledgeToFeedContext } from "@/lib/context/KnowledgeToFeedProvider/hooks/useKnowledgeToFeedContext";
|
|
import { ButtonType } from "@/lib/types/QuivrButton";
|
|
import { Tab } from "@/lib/types/Tab";
|
|
|
|
import { ManageBrains } from "./components/BrainsTabs/components/ManageBrains/ManageBrains";
|
|
import styles from "./page.module.scss";
|
|
|
|
const Studio = (): JSX.Element => {
|
|
const [selectedTab, setSelectedTab] = useState("Manage my brains");
|
|
const { setShouldDisplayFeedCard } = useKnowledgeToFeedContext();
|
|
const { setIsBrainCreationModalOpened } = useBrainCreationContext();
|
|
|
|
const studioTabs: Tab[] = [
|
|
{
|
|
label: "Manage my brains",
|
|
isSelected: selectedTab === "Manage my brains",
|
|
onClick: () => setSelectedTab("Manage my brains"),
|
|
},
|
|
{
|
|
label: "Analytics - Coming soon",
|
|
isSelected: selectedTab === "Analytics",
|
|
onClick: () => setSelectedTab("Analytics"),
|
|
disabled: true,
|
|
},
|
|
];
|
|
|
|
const buttons: ButtonType[] = [
|
|
{
|
|
label: "Create brain",
|
|
color: "primary",
|
|
onClick: () => {
|
|
setIsBrainCreationModalOpened(true);
|
|
},
|
|
},
|
|
{
|
|
label: "Add knowledge",
|
|
color: "primary",
|
|
onClick: () => {
|
|
setShouldDisplayFeedCard(true);
|
|
},
|
|
},
|
|
];
|
|
|
|
return (
|
|
<div className={styles.page_wrapper}>
|
|
<div className={styles.page_header}>
|
|
<PageHeader iconName="brainCircuit" label="Studio" buttons={buttons} />
|
|
</div>
|
|
<div className={styles.content_wrapper}>
|
|
<Tabs tabList={studioTabs} />
|
|
{selectedTab === "Manage my brains" && <ManageBrains />}
|
|
</div>
|
|
<UploadDocumentModal />
|
|
<AddBrainModal />
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default Studio;
|