import React, { Component } from 'react';
import { connect} from 'react-redux'
import * as LeftHeader from 'LeftHeader'
import * as MainWindow from './mainWindow'

import './LeftBar.scss'

export const GetNextNumberForName = (dict, namePrefix) => {
  let highestNumber = 0;
  for (let key in dict) {
        let res = dict[key]['name'].match(`^${namePrefix} ([0-9]+)$`)
        if (res && parseInt(res[1]) > highestNumber)
            highestNumber = parseInt(res[1])
  }
  return highestNumber + 1
}

export const LeftBar = (props : {
  className?:string
}) => {
  const {className} = props
  return (
    <div className={`flexGrow columnFlexBox column column-left ${className}`} >
      <MainWindow.StateMainWindow className='flexGrow' />
    </ div>
  );
}

const mapPropsForLeftBar = (currentState, ownProps) => {
  return {
  }
}
const mapDispatchForLeftBar = (dispatch, ownProps) => {
  return {
  }
}

export var StateLeftBar = connect(mapPropsForLeftBar, mapDispatchForLeftBar)(LeftBar)
