import type {FormInstance} from 'antd' import {Button, Card, Col, Form, Input, Row, Steps, Typography} from 'antd' import type {Connector} from '../../../utils/api/connectors' import {ConnectorProvider} from '../../../utils/api/connectors' import React, {useState} from 'react' import {t} from "ttag" import {BankOutlined, LockOutlined, SignatureOutlined} from "@ant-design/icons" import {formItemLayoutWithOutLabel, providersConfig} from "../../../utils/providers" import DefaultConnectorFormItems from "../../../utils/providers/forms/DefaultConnectorFormItems" export function ConnectorForm({form, onCreate}: { form: FormInstance, onCreate: (values: Connector) => void }) { const [provider, setProvider] = useState() const [current, setCurrent] = useState(0) const ProviderForm = provider !== undefined ? providersConfig[provider].form : undefined const next = () => setCurrent(current + 1) const prev = () => setCurrent(current - 1) form.setFieldValue('provider', provider) return (
, }, { title: t`Authentication`, icon: , disabled: current < 2 }, { title: t`Consent`, icon: , disabled: current < 1 } ]} onChange={(c: number) => setCurrent(c)}/>
{current === 0 && ( <>

{t`Choose a registrar`}

{Object.keys(providersConfig).map((provider: string) => ( { setProvider(provider as ConnectorProvider) next() }} >

{Object.keys(ConnectorProvider).find(p => ConnectorProvider[p as keyof typeof ConnectorProvider] === provider)}

))}
)}
{current > 0 && } {current === 1 && } {current === 2 && }
{t`This website is neither affiliated with nor sponsored by the registrars mentioned. The names and logos of these companies are used for informational purposes only and remain registered trademarks of their respective owners. The use of their services via this website is subject to the terms and conditions set by each registrar and is the sole responsibility of the user.`} ) }