'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _chalk;

function _load_chalk() {
  return _chalk = _interopRequireDefault(require('chalk'));
}

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

exports.default = function (results) {
  var reportComponents = results.map(function (result) {
    var bounds = result.bound.filter(function (bound) {
      return bound.from && bound.to;
    }).map(function (bound) {
      return `\t\tfrom: ${bound.from}, to: ${bound.to}`;
    }).join('\n');
    if (!bounds.length) {
      var reason = result.id.scope ? 'is a nested dependency' : 'was not exported yet';
      return (_chalk || _load_chalk()).default.cyan(`\t${result.id}:\n\t\tnothing to link because the component ${reason}`);
    }
    return (_chalk || _load_chalk()).default.cyan(`\t${result.id}:\n ${bounds}`);
  }).join('\n');

  var reportTitle = (_chalk || _load_chalk()).default.underline(`found ${(_chalk || _load_chalk()).default.bold(results.length.toString())} components\n`);

  return reportTitle + reportComponents;
};