import { setRoute } from './actions-route'

export const showContextmenu = (x, y, menuList) => async dispatch => {
  try {
    dispatch({
      type: 'SHOW-CONTEXTMENU',
      contextmenu: {
        position: {
          x,
          y
        },
        list: menuList
      }
    })
  } catch (error) {
    console.error(error)
  }
}

export const hideContextmenu = () => async dispatch => {
  try {
    dispatch({
      type: 'HIDE-CONTEXTMENU'
    })
  } catch (error) {
    console.error(error)
  }
}
