import Ember from 'ember';
import { CSGO, CREATIVE } from 'web-client/utilities/game-names';

const { LinkComponent } = Ember;

export default LinkComponent.extend({
  didReceiveAttrs() {
    let id = this.get('params')[0];

    let params;
    if (id === CSGO) {
      params = ['directory.csgo.channels'];
    } else if (id === CREATIVE) {
      params = ['directory.creative'];
    } else {
      params = ['directory.game', id];
    }

    this.set('params', params);

    this._super(...arguments);
  }
});
