<commit_before>import * as React from 'react'

interface ITabBarProps {
  /** The currently selected tab. */
  readonly selectedIndex: number

  /** A function which is called when a tab is clicked on. */
  readonly onTabClicked: (index: number) => void

  readonly children?: ReadonlyArray<JSX.Element>
}

/** The tab bar component. */
export class TabBar extends React.Component<ITabBarProps, void> {
  public render() {
    return (
      <div className='tab-bar'>
        {this.renderItems()}
      </div>
    )
  }

  private renderItems() {
    const children = this.props.children as (ReadonlyArray<JSX.Element> | null)
    if (!children) { return null }

    return children.map((child, index) => {
      const selected = index === this.props.selectedIndex
      const className = selected ? 'selected' : ''
      return (
        <div key={index}
              className={'tab-bar-item ' + className}
              onClick={() => this.props.onTabClicked(index)}>
          {child}
        </div>
      )
    })
  }
}<commit_msg>:art: Use classNames in tab-bar<commit_after>import * as React from 'react'
import * as classNames from 'classnames'

interface ITabBarProps {
  /** The currently selected tab. */
  readonly selectedIndex: number

  /** A function which is called when a tab is clicked on. */
  readonly onTabClicked: (index: number) => void

  readonly children?: ReadonlyArray<JSX.Element>
}

/** The tab bar component. */
export class TabBar extends React.Component<ITabBarProps, void> {
  public render() {
    return (
      <div className='tab-bar'>
        {this.renderItems()}
      </div>
    )
  }

  private renderItems() {
    const children = this.props.children as (ReadonlyArray<JSX.Element> | null)
    if (!children) { return null }

    return children.map((child, index) => {
      const selected = index === this.props.selectedIndex
      const className = classNames('tab-bar-item', { selected })
      return (
        <div
          key={index}
          className={className}
          onClick={() => this.props.onTabClicked(index)}
        >
          {child}
        </div>
      )
    })
  }
}
{'fraction_non_alphanumeric': 0.12897196261682242, 'fraction_numerical': 0.0, 'mean_word_length': 2.5983193277310925, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 23, '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': '732390', 'n_tokens_mistral': 620, 'n_tokens_neox': 617, 'n_words': 172}