/*
 *
 * FileContainer actions
 *
 */

import {
  DEFAULT_ACTION,
  UPDATE_FILE_INFO,
  RECEIVE_FILE_ID,
  UPDATE_BY_FILE_ID,
  NEW_CONTAINER_ACTION,
  ADD_NEW_ROW,
  EDIT_ROW,
  MAKE_SAVE_METADATA_ACTION,
  MAKE_SAVE_METADATA_FROM_BACKEND,
  DONT_SHOW_METADATA_FOR_DIRECTORY,
} from './constants';
// import { ADD_NEW_CONTAINER_ACTION } from '../../constants';

export function defaultAction({ frontendId }) {
  return {
    type: DEFAULT_ACTION,
    frontendId,
  };
}

export function makeUpdateFileInfoAction( fileInfo ) {
  return {
    type: UPDATE_FILE_INFO,
    fileInfo,
  };
}

export function receiveFileById({ fileId })
{
  return {
    type: RECEIVE_FILE_ID,
    fileId,
  };
}

export function updateFileById({ fileInfo }) {
  return {
    type: UPDATE_BY_FILE_ID,
    fileInfo,
  };
}

export function makeNewContainerAction(container) {
  return {
    type: NEW_CONTAINER_ACTION,
    container,
  };
}

export function makeChangeNewRowAction(row){
  return {
    type: ADD_NEW_ROW,
    row,
  };
}

export function makeEditRowAction(row,cellName,cellValue){
  return {
    type: EDIT_ROW,
    row,
    cellName,
    cellValue,
  };
}

export function 
() {
  return {
    type: MAKE_SAVE_METADATA_ACTION,
  };
}

export function makeSaveMetaDataFromBackendAction( fileInfo ) {
  return {
    type: MAKE_SAVE_METADATA_FROM_BACKEND,
    fileInfo,
  };
}

export function makeDontShowMetaDataForDirectoryAction( ) {
  return {
    type: DONT_SHOW_METADATA_FOR_DIRECTORY,
  }
}

makeSaveMetaDataAction