import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { PowerhouseButton } from "@powerhousedao/design-system";
import { useForm } from "react-hook-form";
import { FormInput } from "../form-input/form-input.js";
import { AppFormInput } from "./inputs/app-form-input.js";
import { AvailableOfflineToggle } from "./inputs/available-offline-toggle.js";
import { Label } from "./inputs/label.js";
import { SharingTypeFormInput } from "./inputs/sharing-type-form-input.js";
export function AddLocalDriveForm(props) {
    const { register, handleSubmit, control, formState: { errors }, } = useForm({
        defaultValues: {
            name: "",
            sharingType: "LOCAL",
            availableOffline: false,
            appId: props.appOptions[0].id,
        },
    });
    return (_jsx("form", { name: "add-local-drive", onSubmit: handleSubmit(props.onSubmit), className: "flex flex-col gap-4", children: _jsxs("div", { className: "flex flex-col gap-4", children: [_jsxs("div", { children: [_jsx(Label, { htmlFor: "name", className: "text-sm font-medium text-gray-800", children: "Drive Name" }), _jsx(FormInput, { ...register("name", {
                                required: "Drive name is required",
                            }), errorMessage: errors.name?.message, placeholder: "Drive name" })] }), _jsxs("div", { children: [_jsx(Label, { htmlFor: "driveApp", className: "text-sm font-medium text-gray-800", children: "Drive App" }), _jsx(AppFormInput, { control: control, appOptions: props.appOptions })] }), _jsxs("div", { children: [_jsx(Label, { htmlFor: "sharingType", className: "text-sm font-medium text-gray-800", children: "Location" }), _jsx(SharingTypeFormInput, { control: control })] }), _jsx("div", { children: _jsx(AvailableOfflineToggle, { ...register("availableOffline") }) }), _jsx(PowerhouseButton, { className: "mt-2 w-full", type: "submit", children: "Create new drive" })] }) }));
}
//# sourceMappingURL=add-local-drive-form.js.map