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 { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "../../../../components/ui/select"; type Props = { form: UseFormReturn; }; export const SMBForm = ({ form }: Props) => { const guest = useWatch({ control: form.control, name: "guest" }); return ( <> ( Server SMB server IP address or hostname. )} /> ( Share SMB share name on the server. )} /> ( Guest Mode
{ field.onChange(e.target.checked); }} className="rounded border-gray-300" /> Connect as guest (no authentication)
Connect to the SMB share without credentials. Username and password fields will be disabled.
)} /> ( Username Username for SMB authentication. )} /> ( Password Password for SMB authentication. )} /> ( SMB Version SMB protocol version to use (default: 3.0). )} /> ( Domain (Optional) Domain or workgroup for authentication (optional). )} /> ( Port field.onChange(parseInt(e.target.value, 10) || undefined)} /> SMB server port (default: 445). )} /> ( Read-only Mode
field.onChange(e.target.checked)} className="rounded border-gray-300" /> Mount volume as read-only
Prevent any modifications to the volume. Recommended for backup sources and sensitive data.
)} /> ); };