const EVENT_TYPE = "dashboard.component.loading";
export default {
  type: EVENT_TYPE,
  getJs: () => `
    case '${EVENT_TYPE}.start':
      var $comp = $(data.selector);
      if ($comp && !$comp.children('.loader').length) {
          $comp.prepend('<div class="loader"><span class="dot"></span><span class="dot"></span><span class="dot"></span><span class="dot"></span><span class="dot"></span></div>');
      }
      break;\n
    case '${EVENT_TYPE}.end':
      var $comp = $(data.selector);
      if ($comp && $comp.children('.loader').length) {
          $comp.children('.loader').remove();
      }
      break;\n
  `,
};
