module.exports = Header var h = require('virtual-dom/h') var hyperx = require('hyperx') var hx = hyperx(h) function Header (state, dispatch) { var navLeftStyle = process.platform === 'darwin' ? {marginLeft: '78px'} /* OSX needs room on the left for min/max/close buttons */ : null /* On Windows and Linux, the header is separate & underneath the title bar */ return hx`
${getTitle()}
` function getTitle () { if (process.platform === 'darwin') { return hx`
${state.title}
` } } function plusButton () { if (state.url !== '/player') { return hx`add` } } function onBack (e) { dispatch('back') } function onForward (e) { dispatch('forward') } function onAddTorrent (e) { var torrentId = 'magnet:?xt=urn:btih:6a9759bffd5c0af65319979fb7832189f4f3c35d&dn=sintel.mp4' dispatch('addTorrent', torrentId) } }