import { ActionProcessorItem } from '..'
import { Element, Action } from '../../'
import helpers from '@/helpers'

export default class MasterSelectProcessor implements ActionProcessorItem {
  public processValue(element: Element, index: number, rootState: any, rootGetters: any): Action | null {
    if (element.type === 'masters-select') {
      return {
        action: 'loadMasterDataKeys',
        payload: [element.identifier],
      } as Action
    }

    return null
  }
}
