UNPKG

@shopgate/engage

Version:
8 lines 925 B
import{i18n}from'@shopgate/engage/core';/** * Generates form configuration. * @param {Object} options Options for the helper * @param {Array} options.supportedCountries A list of supported countries. * @param {Array} options.countrySortOrder Sort order for supported countries. * @param {Object} options.userLocation User location for better phone picker defaults. * @returns {Object} */var generateFormConfig=function generateFormConfig(_ref){var supportedCountries=_ref.supportedCountries,countrySortOrder=_ref.countrySortOrder,userLocation=_ref.userLocation;return{fields:{email:{type:'email',label:"".concat(i18n.text('checkout.pickup_contact.form.emailAddress')," *")},phone:{type:'phone_picker',label:"".concat(i18n.text('checkout.pickup_contact.form.mobile')," *"),config:{supportedCountries:supportedCountries,countrySortOrder:countrySortOrder,userLocation:userLocation}}}};};export default generateFormConfig;