import { ChangeEvent, ReactNode, useEffect, useMemo, useState } from "react"; import { Button } from "../../ui"; import { ConnectionAdapter } from "./mockAdapter"; import { blankConnection, ConnectionConfig, ConnectionRecord, connectionStates, createConnectionId, DiagnosticCategory, DiagnosticResult, maskedSecret, parseImportPreview, toSafeExport, validateConnection } from "./model"; const field = (config: ConnectionConfig, onChange: (next: ConnectionConfig) => void) => (key: K, value: ConnectionConfig[K]) => onChange({ ...config, [key]: value }); function Section({ title, children }: { title: string; children: ReactNode }) { return
{title}{children}
; } export function TlsSettings({ config, onChange, developmentMode }: { config: ConnectionConfig; onChange: (next: ConnectionConfig) => void; developmentMode: boolean }) { const set = (value: Partial) => onChange({ ...config, tls: { ...config.tls, ...value } }); return