// // Copyright (c) 2025-2026 rustmailer.com (https://rustmailer.com) // // This file is part of the Bichon Email Archiving Project // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . import { FormField, FormItem, FormLabel, FormMessage, FormControl, FormDescription, } from "@/components/ui/form"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from "@/components/ui/select"; import { Input } from "@/components/ui/input"; import { useFormContext, useWatch } from "react-hook-form"; import { Account } from "./action-dialog"; import { PasswordInput } from "@/components/password-input"; import useProxyList from "@/hooks/use-proxy"; import { useTranslation } from "react-i18next"; import { Checkbox } from "@/components/ui/checkbox"; interface StepProps { isEdit: boolean; } export default function Step2({ isEdit }: StepProps) { const { t } = useTranslation() const { control } = useFormContext(); const { proxyOptions } = useProxyList(); const imapAuthMethod = useWatch({ control, name: "imap.auth.auth_type", }); return ( <>
( {t('accounts.imapHost')}: )} /> ( {t('accounts.imapPort')}: field.onChange(parseInt(e.target.value, 10))} /> )} /> ( {t('accounts.imapEncryption')}: {t('accounts.chooseEncryptionMethod')} )} /> ( {t('accounts.useDangerous')}: {t('accounts.useDangerousDescription')} )} /> ( {t('accounts.login_name')}: {t('accounts.nameDescription')} )} /> ( {t('accounts.imapAuthMethod')}: {t('accounts.chooseAuthMethod')} )} /> {imapAuthMethod === "Password" && ( ( {t('accounts.imapPassword')}: {isEdit && ( {t('accounts.leaveEmptyToKeepExisting')} )} )} /> )} ( {t('accounts.useProxy')} ({t('accounts.optional')}): {t('accounts.imapProxy')} )} />
); }