import {
  CLEAR_RCENT_KEYWORD,
  COMPLEX_CONFIG,
  COMPLEX_PATHNAME,
  CREATE_CONEXT,
  EXTEND_OPEN_KEY,
  GENERATE_MENU,
  GET_CONFIG,
  GET_CURRENT_INDEX,
  GET_CURRENT_ROUTES,
  GET_ERROR_CONFIG,
  GET_PATHNAME,
  GET_RCENT_KEYWORD,
  GET_RECENT_PRODUCT,
  GET_RECENT_VISITED,
  GET_THEME_CONFIG,
  LOGIN_MODE,
  SELECT_MENU_KEY,
  SLIDER_MENU_MODE,
  VALIDATE_AUTH,
} from './constants';

export function getConfig(data) {
  return {
    type: GET_CONFIG,
    data,
  };
}

export function getConfigError(error) {
  return {
    type: GET_ERROR_CONFIG,
    error,
  };
}

export function getCurrentRoute(data) {
  return {
    type: GET_CURRENT_ROUTES,
    data,
  };
}
export function createContext(data) {
  return {
    type: CREATE_CONEXT,
    data,
  };
}

export function generateMenu(data) {
  return {
    type: GENERATE_MENU,
    data,
  };
}

export function updageSetting(data) {
  return {
    type: GET_THEME_CONFIG,
    data,
  };
}

export function updateRecentKeywords(data) {
  return {
    type: GET_RCENT_KEYWORD,
    data
  }
}

export function updateRecentVisited(data) {
  return {
    type: GET_RECENT_VISITED,
    data
  }
}

export function updateCurrentIndex(data) {
  return {
    type: GET_CURRENT_INDEX,
    data
  }
}

export function updateRecentProduct(data) {
  return {
    type: GET_RECENT_PRODUCT,
    data
  }
}

export function clearRecentProduct() {
  return {
    type: CLEAR_RCENT_KEYWORD
  }
}

export function updateCollapsed(data) {
  return {
    type: SLIDER_MENU_MODE,
    data
  }
}

export function changeLoginMode(data) {
  return {
    type: LOGIN_MODE,
    data
  }
}

export function updateAuthValidate(data) {
  return {
    type: VALIDATE_AUTH,
    data
  }
}

export function updatePathname(data) {
  return {
    type: GET_PATHNAME,
    data
  }
}

export function updateSelectedKeys(data) {
  return {
    type: SELECT_MENU_KEY,
    data
  }
}

export function updateOpenKeys(data) {
  return {
    type: EXTEND_OPEN_KEY,
    data
  }
}

export function updateComplexConfig(data) {
  return {
    type: COMPLEX_CONFIG,
    data
  }
}

export function updateComplexPathName(data) {
  return {
    type: COMPLEX_PATHNAME,
    data
  }
}