blob: 964ddfbede903c3bd0c3dad79ad6fcfda0bf971b [file] [log] [blame]
// Copyright 2015 The Vanadium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
var debug = require('debug')('components:results-console:render');
var h = require('mercury').h;
var scroll = require('../../event-handlers/scroll');
var followHook = require('./follow-hook');
var log = require('../log');
module.exports = render;
function render(state, channels) {
debug('update console %o', state);
return h('.console', {
className: state.open ? 'open' : 'closed',
'ev-scroll': scroll(channels.follow, { scrolling: true }),
'follow-console': followHook(state.follow)
}, [
h('.text', state.logs.map(log.render))
]);
}