import { ExternalLink } from "lucide-react"; import 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 { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "../../../../components/ui/select"; import { Alert, AlertDescription } from "../../../../components/ui/alert"; import { Input } from "../../../../components/ui/input"; import { listRcloneRemotesOptions } from "~/client/api-client/@tanstack/react-query.gen"; import { useSystemInfo } from "~/client/hooks/use-system-info"; import { useQuery } from "@tanstack/react-query"; type Props = { form: UseFormReturn; }; export const RcloneForm = ({ form }: Props) => { const { capabilities } = useSystemInfo(); const { data: rcloneRemotes, isPending } = useQuery({ ...listRcloneRemotesOptions(), enabled: capabilities.rclone, }); if (!isPending && !rcloneRemotes?.length) { return (

No rclone remotes configured

To use rclone, you need to configure remotes on your host system

View rclone documentation
); } return ( <> ( Remote Select the rclone remote configured on your host system. )} /> ( Path Path on the remote to mount. Use "/" for the root. )} /> ( 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.
)} /> ); };