import { Button } from "@/components/ui/button"; import { CodeEditor } from "@/components/ui/codeEditor"; import { FormControl, FormField, FormItem, FormLabel, FormMessage } from "@/components/ui/form"; import { Input } from "@/components/ui/input"; import { Info, PlusIcon } from "lucide-react"; import { useState } from "react"; import { UseFormReturn } from "react-hook-form"; interface PluginFormData { name: string; path: string; config?: string; hasConfig: boolean; } interface PluginFormFragmentProps { form: UseFormReturn; isEditMode?: boolean; } export function PluginFormFragment({ form, isEditMode = false }: PluginFormFragmentProps) { const [showConfig, setShowConfig] = useState(form.getValues("hasConfig") || false); return (

{isEditMode ? "Update your plugin configuration. Plugin name and path are read-only." : "Install a custom plugin by providing an absolute file path or HTTP URL accessible to Bifrost deployment (.so)."}{" "} Learn more

( Plugin Name * )} /> ( Plugin Path/URL * )} /> {!showConfig ? ( ) : ( (
Configuration (JSON)
)} /> )}
); }