import React from "react"; import { Plug, RotateCcw } from "lucide-react"; import type { Host, Identity, SSHKey } from "../types"; import { usePluginConnectionSectionState } from "../application/state/usePluginConnectionSectionState"; import { HostDetailsSection } from "./host-details"; import { Button } from "./ui/button"; import { Combobox } from "./ui/combobox"; type Props = { form: Host; setForm: React.Dispatch>; t: (key: string, params?: Record) => string; onValidityChange: (valid: boolean) => void; identities: Identity[]; keys: SSHKey[]; }; export const PluginConnectionSection: React.FC = ({ form, setForm, t, onValidityChange, identities, keys, }) => { const state = usePluginConnectionSectionState({ form, setForm, t, onValidityChange, identities, keys, }); if (!state.active && state.providerCount === 0) return null; return ( } title={t("hostDetails.plugin.title")} hint={state.active && !state.installed ? t("hostDetails.plugin.unavailable") : undefined} > {state.active ? ( <>