/** * This component ... */ import React, { BaseSyntheticEvent, SyntheticEvent, useState } from 'react'; import { react2angular } from 'react2angular'; import { Loader } from './loader'; import { IApplication } from '../models/application'; import { useTranslation } from 'react-i18next'; import { FabModal, ModalSize } from './fab-modal'; import { User } from '../models/user'; declare var Application: IApplication; interface SelectGatewayModalModalProps { isOpen: boolean, toggleModal: () => void, currentUser: User, } const SelectGatewayModal: React.FC = ({ isOpen, toggleModal }) => { const { t } = useTranslation('admin'); const [preventConfirmGateway, setPreventConfirmGateway] = useState(true); const [selectedGateway, setSelectedGateway] = useState(''); /** * Callback triggered when the user has filled and confirmed the settings of his gateway */ const onGatewayConfirmed = () => { setPreventConfirmGateway(true); toggleModal(); } const setGateway = (event: BaseSyntheticEvent) => { const gateway = event.target.value; setSelectedGateway(gateway); setPreventConfirmGateway(!gateway); } return (

{t('app.admin.invoices.payment.gateway_modal.gateway_info')}

); } const SelectGatewayModalWrapper: React.FC = ({ isOpen, toggleModal, currentUser }) => { return ( ); } Application.Components.component('selectGatewayModal', react2angular(SelectGatewayModalWrapper, ['isOpen', 'toggleModal', 'currentUser']));