<commit_before>import React from 'react'
import PropTypes from 'prop-types'
import { Button, Icon, List, Loader, Message } from 'semantic-ui-react'
import { FormattedMessage } from 'react-intl'
import { Query } from 'react-apollo'

import { QUESTION_TYPES } from '../../lib'
import { TagListQuery } from '../../graphql'

const propTypes = {
  activeTags: PropTypes.array.isRequired,
  activeType: PropTypes.string.isRequired,
  handleReset: PropTypes.func.isRequired,
  handleTagClick: PropTypes.func.isRequired,
  handleToggleArchive: PropTypes.func.isRequired,
  isArchiveActive: PropTypes.bool,
}

const defaultProps = {
  isArchiveActive: false,
}

export const TagListPres = ({
  activeTags,
  isArchiveActive,
  activeType,
  handleTagClick,
  handleReset,
  handleToggleArchive,
}) => (
  <div className="tagList">
    <Button basic fluid onClick={() => handleReset()}>
      <Icon name="remove circle" />
      <FormattedMessage defaultMessage="Reset filters" id="tagList.button.reset" />
    </Button>
    <List selection size="large">
      <List.Header className="listHeader archive">
        <FormattedMessage defaultMessage="Archive" id="tagList.header.archive" />
      </List.Header>
      <List.Item active={isArchiveActive} className="listItem archiveItem" onClick={() => handleToggleArchive(true)}>
        <List.Icon name="archive" />
        <List.Content>
          <FormattedMessage defaultMessage="Show Archive" id="tagList.string.showArchive" />
        </List.Content>
      </List.Item>
      <List.Item active={!isArchiveActive} className="listItem archiveItem" onClick={() => handleToggleArchive(false)}>
        <List.Icon name="list" />
        <List.Content>
          <FormattedMessage defaultMessage="Show Pool" id="tagList.string.showPool" />
        </List.Content>
      </List.Item>
      <List.Header className="listHeader types">
        <FormattedMessage defaultMessage="Types" id="tagList.header.types" />
      </List.Header>
      <List.Item
        active={activeType === QUESTION_TYPES.SC}
        className="listItem"
        key="SC"
        onClick={() => handleTagClick('SC', true)}
      >
        <List.Icon name={activeType === QUESTION_TYPES.SC ? 'folder' : 'folder outline'} />
        <List.Content>
          <FormattedMessage defaultMessage="Single Choice (SC)" id="common.SC.label" />
        </List.Content>
      </List.Item>
      <List.Item
        active={activeType === QUESTION_TYPES.MC}
        className="listItem"
        key="MC"
        onClick={() => handleTagClick('MC', true)}
      >
        <List.Icon name={activeType === QUESTION_TYPES.MC ? 'folder' : 'folder outline'} />
        <List.Content><commit_msg>Optimize archive distinction<commit_after>import React from 'react'
import PropTypes from 'prop-types'
import { Button, Icon, List, Loader, Message } from 'semantic-ui-react'
import { FormattedMessage } from 'react-intl'
import { Query } from 'react-apollo'

import { QUESTION_TYPES } from '../../lib'
import { TagListQuery } from '../../graphql'

const propTypes = {
  activeTags: PropTypes.array.isRequired,
  activeType: PropTypes.string.isRequired,
  handleReset: PropTypes.func.isRequired,
  handleTagClick: PropTypes.func.isRequired,
  handleToggleArchive: PropTypes.func.isRequired,
  isArchiveActive: PropTypes.bool,
}

const defaultProps = {
  isArchiveActive: false,
}

export const TagListPres = ({
  activeTags,
  isArchiveActive,
  activeType,
  handleTagClick,
  handleReset,
  handleToggleArchive,
}) => (
  <div className="tagList">
    <Button basic fluid onClick={() => handleReset()}>
      <Icon name="remove circle" />
      <FormattedMessage defaultMessage="Reset filters" id="tagList.button.reset" />
    </Button>
    <List selection size="large">
      <List.Item active={isArchiveActive} className="listItem archiveItem" onClick={() => handleToggleArchive(true)}>
        <List.Icon name="archive" />
        <List.Content>
          <FormattedMessage defaultMessage="Question Archive" id="tagList.string.showArchive" />
        </List.Content>
      </List.Item>
      <List.Item active={!isArchiveActive} className="listItem archiveItem" onClick={() => handleToggleArchive(false)}>
        <List.Icon name="list" />
        <List.Content>
          <FormattedMessage defaultMessage="Question Pool" id="tagList.string.showPool" />
        </List.Content>
      </List.Item>
      <List.Header className="listHeader types">
        <FormattedMessage defaultMessage="Types" id="tagList.header.types" />
      </List.Header>
      <List.Item
        active={activeType === QUESTION_TYPES.SC}
        className="listItem"
        key="SC"
        onClick={() => handleTagClick('SC', true)}
      >
        <List.Icon name={activeType === QUESTION_TYPES.SC ? 'folder' : 'folder outline'} />
        <List.Content>
          <FormattedMessage defaultMessage="Single Choice (SC)" id="common.SC.label" />
        </List.Content>
      </List.Item>
      <List.Item
        active={activeType === QUESTION_TYPES.MC}
        className="listItem"
        key="MC"
        onClick={() => handleTagClick('MC', true)}
      >
        <List.Icon name={activeType === QUESTION_TYPES.MC ? 'folder' : 'folder outline'} />
        <List.Content>
{'fraction_non_alphanumeric': 0.14416650754248617, 'fraction_numerical': 0.0, 'mean_word_length': 3.3182192910140147, 'pattern_counts': {'":': 0, '<': 66, '<?xml version=': 0, '>': 78, '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': '3086736', 'n_tokens_mistral': 1529, 'n_tokens_neox': 1546, 'n_words': 310}