import { Layers } from "lucide-react"; import { useTranslation, type HostEditorSectionProps, } from "@termix/plugin-sdk/frontend"; import { FakeSwitch, SectionCard, SettingRow } from "@termix/plugin-sdk/ui"; type PluginSettingsForm = Record>; /** * The host editor's tmux monitor toggle. Writes into the form's * pluginSettings for this plugin, which the editor saves through the * plugin's host settings route after the host itself. */ export function HostTmuxMonitorSection({ form, updateForm, }: HostEditorSectionProps) { const { t } = useTranslation(); const settings = ((form?.pluginSettings as PluginSettingsForm | undefined)?.[ "tmux-monitor" ] ?? {}) as Record; const enabled = settings.enableTmuxMonitor === true; const setEnabled = (value: boolean) => updateForm((current) => { const all = (current.pluginSettings ?? {}) as PluginSettingsForm; return { ...current, pluginSettings: { ...all, "tmux-monitor": { ...all["tmux-monitor"], enableTmuxMonitor: value }, }, }; }); return ( } >
{t("hosts.enableTmuxMonitorDesc")}{" "} {t("hosts.docsLink")} } >
); }