<commit_before>import $ from 'jquery';
import { themes } from '../helpers/ThemeManager';

class ThemeSelector {

  /** @type string */
  _value;

  /** @type jQuery */
  $selector;

  constructor(initialValue) {
    this.$selector = $('<div />')
      .addClass('theme-selector');

    Object.keys(themes).forEach((value) => {
      const $item = $('<div />')
        .appendTo(this.$selector)
        .addClass('theme-selector__item')
        .data('value', value)
        .on('click', () => {
          this.value = value;
        });

      $('<div />')
        .appendTo($item)
        .addClass('theme-selector__thumb')
        .append(this.createThumb(value));

      $('<div />')
        .appendTo($item)
        .addClass('theme-selector__label')
        .text(themes[value].value);
    });

    this.value = initialValue;
  }

  createThumb(theme) {
    const $thumb = $('<div />')
      .addClass(`theme-thumb theme-thumb--${theme}`);<commit_msg>Fix name not being added in theme selector<commit_after>import $ from 'jquery';
import { themes } from '../helpers/ThemeManager';

class ThemeSelector {

  /** @type string */
  _value;

  /** @type jQuery */
  $selector;

  constructor(initialValue) {
    this.$selector = $('<div />')
      .addClass('theme-selector');

    Object.keys(themes).forEach((value) => {
      const $item = $('<div />')
        .appendTo(this.$selector)
        .addClass('theme-selector__item')
        .data('value', value)
        .on('click', () => {
          this.value = value;
        });

      $('<div />')
        .appendTo($item)
        .addClass('theme-selector__thumb')
        .append(this.createThumb(value));

      $('<div />')
        .appendTo($item)
        .addClass('theme-selector__label')
        .text(themes[value].name);
    });

    this.value = initialValue;
  }

  createThumb(theme) {
    const $thumb = $('<div />')
      .addClass(`theme-thumb theme-thumb--${theme}`);
{'fraction_non_alphanumeric': 0.19484536082474227, 'fraction_numerical': 0.0, 'mean_word_length': 2.358131487889273, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 17, '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': '3623161', 'n_tokens_mistral': 602, 'n_tokens_neox': 585, 'n_words': 98}