import { Map, List, fromJS } from 'immutable'


export function panes(state = List([
  { title: 'Tab 1', content: 'Content of Tab 1', key: '1' },
  { title: 'Tab 2', content: 'Content of Tab 2', key: '2' },
  {
    title: 'Tab 3',
    content: 'Content of Tab 3',
    key: '3',
    closable: false,
  },
]), action) {
  switch (action.type) {
    case 'add':
      return state.push(action.data)
    case 'remove': 
      state = state.filter((item) => {
        return action.data.key !== item.key
      })
      console.log(2222, state)
      return state
    default:
      return state
  }
}