diff --git a/src/components/wizard/SftpAuthToggle.tsx b/src/components/wizard/SftpAuthToggle.tsx new file mode 100644 index 0000000..5a4fbd2 --- /dev/null +++ b/src/components/wizard/SftpAuthToggle.tsx @@ -0,0 +1,69 @@ +import { useState } from 'react'; +import type { UseFormRegister, FieldError } from 'react-hook-form'; +import { PasswordField } from '../ui/PasswordField'; + +type AuthMethod = 'password' | 'key'; + +interface SftpAuthToggleProps { + register: UseFormRegister; + errors: { + pass?: FieldError; + key_pem?: FieldError; + }; +} + +export function SftpAuthToggle({ register, errors }: SftpAuthToggleProps) { + const [authMethod, setAuthMethod] = useState('password'); + + return ( +
+ {/* Segmented control */} +
+ + +
+ + {/* Both fields always registered — only active one visible via CSS */} +
+ +
+
+ +
+
+ ); +}