import React, { FunctionComponent, ReactNode } from 'react'; import { AbstractPaymentModal, GatewayFormProps } from '../abstract-payment-modal'; import { LocalPaymentForm } from './local-payment-form'; import { ShoppingCart } from '../../../models/payment'; import { PaymentSchedule } from '../../../models/payment-schedule'; import { User } from '../../../models/user'; import { Invoice } from '../../../models/invoice'; import { useTranslation } from 'react-i18next'; import { ModalSize } from '../../base/fab-modal'; import { Loader } from '../../base/loader'; import { react2angular } from 'react2angular'; import { IApplication } from '../../../models/application'; declare const Application: IApplication; interface LocalPaymentModalProps { isOpen: boolean, toggleModal: () => void, afterSuccess: (result: Invoice|PaymentSchedule) => void, onError: (message: string) => void, cart: ShoppingCart, currentUser: User, schedule?: PaymentSchedule, customer: User } /** * This component enables a privileged user to confirm a local payments. */ const LocalPaymentModalComponent: React.FC = ({ isOpen, toggleModal, afterSuccess, onError, cart, currentUser, schedule, customer }) => { const { t } = useTranslation('admin'); /** * Return the logos, shown in the modal footer. */ const logoFooter = (): ReactNode => { return (
); }; /** * Integrates the LocalPaymentForm into the parent AbstractPaymentModal */ const renderForm: FunctionComponent = ({ onSubmit, onSuccess, onError, operator, className, formId, cart, customer, paymentSchedule, children }) => { return ( {children} ); }; return ( ); }; export const LocalPaymentModal: React.FC = ({ isOpen, toggleModal, afterSuccess, onError, currentUser, schedule, cart, customer }) => { return ( ); }; Application.Components.component('localPaymentModal', react2angular(LocalPaymentModal, ['isOpen', 'toggleModal', 'afterSuccess', 'onError', 'currentUser', 'schedule', 'cart', 'customer']));