import type { FormInstance} from 'antd' import {Alert, Button, Checkbox, Form, Input, Popconfirm, Select, Space, Typography} from 'antd' import React, {useState} from 'react' import type {Connector} from '../../../utils/api/connectors' import { ConnectorProvider} from '../../../utils/api/connectors' import {t} from 'ttag' import {BankOutlined} from '@ant-design/icons' import { ovhEndpointList as ovhEndpointListFunction, ovhFields as ovhFieldsFunction, ovhPricingMode as ovhPricingModeFunction, ovhSubsidiaryList as ovhSubsidiaryListFunction } from '../../../utils/providers/ovh' import {helpGetTokenLink, tosHyperlink} from '../../../utils/providers' const formItemLayoutWithOutLabel = { wrapperCol: { xs: {span: 24, offset: 0}, sm: {span: 20, offset: 4} } } export function ConnectorForm({form, onCreate}: { form: FormInstance, onCreate: (values: Connector) => void }) { const [provider, setProvider] = useState() const ovhFields = ovhFieldsFunction() const ovhEndpointList = ovhEndpointListFunction() const ovhSubsidiaryList = ovhSubsidiaryListFunction() const ovhPricingMode = ovhPricingModeFunction() const [open, setOpen] = useState(false) const [ovhPricingModeValue, setOvhPricingModeValue] = useState() return (
) } { form.resetFields(['authData']) setOvhPricingModeValue(undefined) setOpen(false) }} onConfirm={() => setOpen(false)} open={open} > {t`It indicates the organization that will pay for the ordered product`} } required={false} > } { provider === ConnectorProvider.AUTODNS && <>
{t`Attention: AutoDNS do not support 2-Factor Authentication on API Users for automated systems`} } rules={[{required: true, message: t`Required`}]} > {t`The nic-handle of the domain name owner`}{t`You can get it from this page`} } rules={[{required: true, message: t`Required`}]} required > {t`If you not sure, use the default value 4`} } required={false} > {t`Owner confirms his consent of domain order jobs`} } { provider === ConnectorProvider.NAMECHEAP && <> } { provider !== undefined && <> {t`I have read and accepted the conditions of use of the Provider API, accessible from this hyperlink`} {t`I am of the minimum age required to consent to these conditions`} {t`I waive my right of withdrawal regarding the purchase of domain names via the Provider's API`} } ) }