import { Settings } from '@greenpay/models'
import { getSetting } from '@woocommerce/settings'
import { SETTINGS_KEY } from '../data/constants'

/** Read block checkout payment settings from wcSettings (available synchronously on checkout). */
export const getBlocksSettingsSync = (): Settings | null => {
	try {
		return getSetting(SETTINGS_KEY) ?? null
	} catch {
		return null
	}
}
