diff --git a/frontend/lib/api/brain/types.ts b/frontend/lib/api/brain/types.ts index 32b846911340..ddd8437bad3d 100644 --- a/frontend/lib/api/brain/types.ts +++ b/frontend/lib/api/brain/types.ts @@ -1,4 +1,5 @@ import { BrainRoleType } from "@/lib/components/BrainUsers/types"; +import { BrainStatus } from "@/lib/types/brainConfig"; export type SubscriptionUpdatableProperties = { role: BrainRoleType | null; @@ -7,7 +8,7 @@ export type SubscriptionUpdatableProperties = { export type CreateBrainInput = { name: string; description?: string; - status?: string; + status?: BrainStatus; model?: string; temperature?: number; max_tokens?: number; diff --git a/frontend/lib/components/AddBrainModal/AddBrainModal.tsx b/frontend/lib/components/AddBrainModal/AddBrainModal.tsx index 6742eb65763e..2d2c33256b37 100644 --- a/frontend/lib/components/AddBrainModal/AddBrainModal.tsx +++ b/frontend/lib/components/AddBrainModal/AddBrainModal.tsx @@ -1,5 +1,6 @@ +/* eslint-disable max-lines */ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ -/* eslint-disable */ + import { useTranslation } from "react-i18next"; import { MdAdd } from "react-icons/md"; @@ -9,9 +10,11 @@ import Field from "@/lib/components/ui/Field"; import { Modal } from "@/lib/components/ui/Modal"; import { defineMaxTokens } from "@/lib/helpers/defineMaxTokens"; +import { PublicAccessConfirmationModal } from "./components/PublicAccessConfirmationModal"; +import { useAddBrainModal } from "./hooks/useAddBrainModal"; import { Divider } from "../ui/Divider"; +import { Radio } from "../ui/Radio"; import { TextArea } from "../ui/TextArea"; -import { useAddBrainModal } from "./hooks/useAddBrainModal"; export const AddBrainModal = (): JSX.Element => { const { t } = useTranslation(["translation", "brain", "config"]); @@ -20,150 +23,170 @@ export const AddBrainModal = (): JSX.Element => { isShareModalOpen, setIsShareModalOpen, register, - openAiKey, temperature, maxTokens, model, isPending, pickPublicPrompt, accessibleModels, + brainStatusOptions, + status, + isPublicAccessConfirmationModalOpened, + onCancelPublicAccess, + onConfirmPublicAccess, } = useAddBrainModal(); return ( - void 0} - variant={"tertiary"} - className="border-0" - data-testid="add-brain-button" - > - {t("newBrain", { ns: "brain" })} - - - } - title={t("newBrainTitle", { ns: "brain" })} - desc={t("newBrainSubtitle", { ns: "brain" })} - isOpen={isShareModalOpen} - setOpen={setIsShareModalOpen} - CloseTrigger={
} - > -
{ - e.preventDefault(); - void handleSubmit(); - }} - className="my-10 flex flex-col items-center gap-2" - > - - -