blob: 3349a00d45c1e8c50f759e5ca179d2d6baa8b8d1 [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:bundles');
var h = require('mercury').h;
var anchor = require('../../router/anchor');
var toArray = require('../../util').toArray;
module.exports = render;
function render(state) {
debug('update %o', state);
var bundles = toArray(state);
if (bundles.length === 0) {
return h('p', 'Loading...');
} else {
return h('ul.bundles', bundles.map(li));
}
}
function li(bundle) {
return h('li', [
anchor({ href: '/' + bundle.uuid }, bundle.uuid)
]);
}