/**
 * Created by larryjones on 6/25/17.
 */

import { List, Map } from 'immutable';
import React from 'react';
import { Route } from 'react-router-dom';
import Voting from './components/Voting';
import Results from './components/Results';

const pair = List.of('Trainspotting', '28 Days Later');
const tally = Map({'Trainspotting': 5, '28 Days Later': 4});
const winner = 'Trainspotting';

const renderVoting = props => <Voting {...props} pair={pair} />;
const renderResults = props => <Results {...props} pair={pair} tally={tally} winner={winner} />;

const App = () => (
  <div>
    <Route exact path="/" render={ renderVoting } />
    <Route path="/results" render={ renderResults } />
  </div>
);

export default App;

@@ -230,24 +230,242 @@
 /Results';%0A%0A
+/*%0A const pair = %5B'Trainspotting', '28 Days Later'%5D;%0A const voteFor = (entry) =%3E %7B%0A console.log(%60Voted for $%7Bentry%7D%60);%0A %7D;%0A const props = %7B%0A pair,%0A voteFor%0A %7D;%0A */%0A/*%0A const props = %7B%0A winner: 'Trainspotting'%0A %7D;%0A */%0A%0A
 const pair =
@@ -572,40 +572,8 @@
 4%7D);
-%0Aconst winner = 'Trainspotting';
 %0A%0Aco
@@ -635,16 +635,16 @@
 ir%7D /%3E;%0A
+
 const re
@@ -715,24 +715,8 @@
 lly%7D
- winner=%7Bwinner%7D
  /%3E;

Revert "Verify winner (hard-coded)"