import { useWatch, type UseFormReturn } from "react-hook-form"; import type { FormValues } from "../create-volume-form"; import { FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, } from "../../../../components/ui/form"; import { Input } from "../../../../components/ui/input"; import { SecretInput } from "../../../../components/ui/secret-input"; import { Textarea } from "../../../../components/ui/textarea"; import { Switch } from "../../../../components/ui/switch"; type Props = { form: UseFormReturn; }; export const SFTPForm = ({ form }: Props) => { const skipHostKeyCheck = useWatch({ control: form.control, name: "skipHostKeyCheck" }); return ( <> ( Host SFTP server hostname or IP address. )} /> ( Port field.onChange(parseInt(e.target.value, 10) || undefined)} /> SFTP server port (default: 22). )} /> ( Username Username for SFTP authentication. )} /> ( Password (Optional) Password for SFTP authentication (optional if using private key). )} /> ( Private Key (Optional)