var ipcRenderer = require('electron').ipcRenderer;
var electron = require('electron');

ipcRenderer.on('status', function(event, data) {
  document.querySelector('.js-loading').classList.add('hidden');

  if (data === 'loaded') {
    document.querySelector('.js-success').classList.remove('hidden');
  } else {
    var errorContainer = document.querySelector('.js-error');
    errorContainer.classList.remove('hidden');
    errorContainer.querySelector('.js-error-message').innerHTML = JSON.stringify(data);
  }
});

function openLink(url) {
  electron.shell.openExternal(url);
}
