diff --git a/autogpt_platform/frontend/src/app/(platform)/admin/llms/components/AddModelForm.tsx b/autogpt_platform/frontend/src/app/(platform)/admin/llms/components/AddModelForm.tsx deleted file mode 100644 index 7008ef6b6f..0000000000 --- a/autogpt_platform/frontend/src/app/(platform)/admin/llms/components/AddModelForm.tsx +++ /dev/null @@ -1,207 +0,0 @@ -import type { LlmProvider } from "@/lib/autogpt-server-api/types"; -import { createLlmModelAction } from "../actions"; -import { Button } from "@/components/atoms/Button/Button"; - -interface Props { - providers: LlmProvider[]; -} - -export function AddModelForm({ providers }: Props) { - return ( -
- ); -} diff --git a/autogpt_platform/frontend/src/app/(platform)/admin/llms/components/AddModelModal.tsx b/autogpt_platform/frontend/src/app/(platform)/admin/llms/components/AddModelModal.tsx new file mode 100644 index 0000000000..2505b1be4f --- /dev/null +++ b/autogpt_platform/frontend/src/app/(platform)/admin/llms/components/AddModelModal.tsx @@ -0,0 +1,239 @@ +"use client"; + +import { useState } from "react"; +import { Dialog } from "@/components/molecules/Dialog/Dialog"; +import { Button } from "@/components/atoms/Button/Button"; +import type { LlmProvider } from "@/lib/autogpt-server-api/types"; +import { createLlmModelAction } from "../actions"; +import { useRouter } from "next/navigation"; + +interface Props { + providers: LlmProvider[]; +} + +export function AddModelModal({ providers }: Props) { + const [open, setOpen] = useState(false); + const router = useRouter(); + + return ( + + ); +} + diff --git a/autogpt_platform/frontend/src/app/(platform)/admin/llms/components/AddProviderForm.tsx b/autogpt_platform/frontend/src/app/(platform)/admin/llms/components/AddProviderForm.tsx deleted file mode 100644 index f21c447263..0000000000 --- a/autogpt_platform/frontend/src/app/(platform)/admin/llms/components/AddProviderForm.tsx +++ /dev/null @@ -1,204 +0,0 @@ -import { createLlmProviderAction } from "../actions"; -import { Button } from "@/components/atoms/Button/Button"; - -export function AddProviderForm() { - return ( - - ); -} diff --git a/autogpt_platform/frontend/src/app/(platform)/admin/llms/components/AddProviderModal.tsx b/autogpt_platform/frontend/src/app/(platform)/admin/llms/components/AddProviderModal.tsx new file mode 100644 index 0000000000..dae07e87a7 --- /dev/null +++ b/autogpt_platform/frontend/src/app/(platform)/admin/llms/components/AddProviderModal.tsx @@ -0,0 +1,236 @@ +"use client"; + +import { useState } from "react"; +import { Dialog } from "@/components/molecules/Dialog/Dialog"; +import { Button } from "@/components/atoms/Button/Button"; +import { createLlmProviderAction } from "../actions"; +import { useRouter } from "next/navigation"; + +export function AddProviderModal() { + const [open, setOpen] = useState(false); + const router = useRouter(); + + return ( + + ); +} + diff --git a/autogpt_platform/frontend/src/app/(platform)/admin/llms/components/LlmRegistryDashboard.tsx b/autogpt_platform/frontend/src/app/(platform)/admin/llms/components/LlmRegistryDashboard.tsx index b00c40beaa..d9aa55198e 100644 --- a/autogpt_platform/frontend/src/app/(platform)/admin/llms/components/LlmRegistryDashboard.tsx +++ b/autogpt_platform/frontend/src/app/(platform)/admin/llms/components/LlmRegistryDashboard.tsx @@ -1,17 +1,8 @@ "use client"; -import { useState } from "react"; -import { CaretDown } from "@phosphor-icons/react"; import type { LlmModel, LlmProvider } from "@/lib/autogpt-server-api/types"; -import { - DropdownMenu, - DropdownMenuContent, - DropdownMenuItem, - DropdownMenuTrigger, -} from "@/components/molecules/DropdownMenu/DropdownMenu"; -import { Button } from "@/components/atoms/Button/Button"; -import { AddProviderForm } from "./AddProviderForm"; -import { AddModelForm } from "./AddModelForm"; +import { AddProviderModal } from "./AddProviderModal"; +import { AddModelModal } from "./AddModelModal"; import { ProviderList } from "./ProviderList"; import { ModelsTable } from "./ModelsTable"; @@ -20,15 +11,7 @@ interface Props { models: LlmModel[]; } -type FormType = "model" | "provider" | null; - export function LlmRegistryDashboard({ providers, models }: Props) { - const [activeForm, setActiveForm] = useState