import { FormPlugin , FormAnalytics , FormTellAFriend , FinishMessageCustom , } from '../bonde-webpage' ; import fetch from 'node-fetch' ; import Utils from '../Utils' ; const FormConnected = ( props ) => < FormPlugin { ... props } asyncFormEntryCreate = { async ( args ) => ( await fetch ( '/api/actions/form' , { method : 'post' , body : JSON . stringify ( args ) , headers : { 'Content-Type' : 'application/json' } , } ) ) . json ( ) } widget = { { ... props . widget , settings : { ... props . widget . settings , fields : props . widget . settings . fields ? JSON . parse ( props . widget . settings . fields ) : [ ] , } , } } analyticsEvents = { FormAnalytics } overrides = { { FinishCustomMessage : { component : FinishMessageCustom } , FinishDefaultMessage : { component : FormTellAFriend , props : { imageUrl : Utils . imageUrl , href : Utils . getSharedPath ( props . mobilization ) , } , } , } } />; export default FormConnected ;