import Split from 'split.js';

export const initSplit = (panes, options) => {
  const defaults = {
    elementStyle (dimension, size, gutterSize) {
      return {
        'flex-basis': `calc(${size}% - ${gutterSize}px)`,
      };
    },
    gutterStyle(dimension, gutterSize) {
      return {
        'flex-basis':  `${gutterSize}px`,
      };
    },
    onDragEnd(){
    },
  };
  const splitOptions = Object.assign(defaults, options);
  const split = Split(panes, splitOptions);
  return split;
}