import { ValueProcessorItem } from '..'
import { Action, Element } from '../../'
import helpers from '@/helpers'
import _ from 'lodash'

export default class MasterSelectProcessor implements ValueProcessorItem {
  public processValue(element: Element, index: number, rootState: any, rootGetters: any) {
    if (element.type === 'masters-select') {
      element.options = rootGetters.getMasterDataOptionsByKey(element.identifier)

      element.type = 'select'
    }

    return element
  }
}
