<commit_before>import Ember from 'ember';

export default Ember.Component.extend({
  classNames: ['code-theme-selector'],
  classNameBindings: ['themeClass'],

  codeTheme: Ember.inject.service(),

  themeClass: Ember.computed.alias('codeTheme.className'),

  click() {
    this.get('codeTheme').toggle();
  },
});<commit_msg>add code-theme-selector component documentation (#344)<commit_after>import Ember from 'ember';
import { alias } from 'ember-computed';

const {
  Component,
  get,
  inject,
} = Ember;

const { service } = inject;

/**
 * The `code-theme-selector` component is used to toggle code themes on
 * posts/comments/etc.
 *
 * @class code-theme-selector
 * @module Component
 * @extends Ember.Component
 */
export default Component.extend({
  classNames: ['code-theme-selector'],
  classNameBindings: ['themeClass'],

  /**
   * @property codeTheme
   * @type Ember.Service
   */
  codeTheme: service(),

  /**
   * Returns the current code theme's class name.
   *
   * @property themeClass
   * @type String
   */
  themeClass: alias('codeTheme.className'),

  /**
   * Fires on click. Toggles the code theme.
   *
   * @method click
   */
  click() {
    get(this, 'codeTheme').toggle();
  },
});
{'fraction_non_alphanumeric': 0.1535303776683087, 'fraction_numerical': 0.0024630541871921183, 'mean_word_length': 3.617424242424242, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4922407', 'n_tokens_mistral': 390, 'n_tokens_neox': 378, 'n_words': 92}