import { useTranslation } from "react-i18next"; import { IoChevronDown, IoChevronForward } from "react-icons/io5"; import { I18nKey } from "#/i18n/declaration"; import { PluginSpec } from "#/api/conversation-service/agent-server-conversation-service.types"; import { Typography } from "#/ui/typography"; import { PluginLaunchParameterInput } from "./plugin-launch-parameter-input"; export interface PluginLaunchPluginSectionProps { plugin: PluginSpec; originalIndex: number; isExpanded: boolean; onToggle: () => void; getPluginDisplayName: (plugin: PluginSpec) => string; onParameterChange: ( pluginIndex: number, paramKey: string, value: unknown, ) => void; } export function PluginLaunchPluginSection({ plugin, originalIndex, isExpanded, onToggle, getPluginDisplayName, onParameterChange, }: PluginLaunchPluginSectionProps) { const { t } = useTranslation("openhands"); const hasParams = plugin.parameters && Object.keys(plugin.parameters).length > 0; if (!hasParams) { return null; } return (
{isExpanded && (
{plugin.ref && (
{t(I18nKey.LAUNCH$PLUGIN_REF)} {plugin.ref}
)} {plugin.repo_path && (
{t(I18nKey.LAUNCH$PLUGIN_PATH)} {plugin.repo_path}
)}
{Object.entries(plugin.parameters || {}).map(([key, value]) => ( ))}
)}
); }