import { createStore } from 'redux';
import reducer from 'reducers/reducers.js';

const initialState = {
  selectedkey: 0,
  kexp: 1.0,
  krdel: 1.0,
  components: [
    {
      type: 'Suministro',
      originoruse: 'EPB',
      carrier: 'ELECTRICIDAD',
      values: [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
    },
    {
      type: 'Suministro',
      originoruse: 'NEPB',
      carrier: 'ELECTRICIDAD',
      values: [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
    },
    {
      type: 'Producción',
      originoruse: 'INSITU',
      carrier: 'MEDIOAMBIENTE',
      values: [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
    },
    {
      type: 'Producción',
      originoruse: 'COGENERACION',
      carrier: 'ELECTRICIDAD',
      values: [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
    }
  ]

};

export default createStore (
  reducer,
  initialState
);

@@ -104,23 +104,111 @@
 %7B%0A  
-selectedkey: 0,
+maxvalue: 1, // Maximum value in all component values%0A  selectedkey: 0, // Currently selected component
 %0A  k
@@ -246,16 +246,43 @@
 nents: %5B
+ // Energy components array
 %0A    %7B%0A 

add maxvalue