import Component from 'ember-component';
import injectService from 'ember-service/inject';
import $ from 'jquery';

// Base component for front page side bar categories
export default Component.extend({
  feeds: injectService(),

  actions: {
    trackCategoryClick(e) {
      let url = $(e.target).closest('a.js-tracking-anchor').attr('href');
      this.get('feeds').trackEvent('home_page_link_click', this.get('trackingInfo'), {url});
    }
  }
});
