<commit_before>import { h, render, Component } from 'preact';
import uuidv4 from 'uuid/v4';
import './index.css';
import Guid from './Guid';
import Validate from './Validate';

class App extends Component {
  constructor(props) {
    super(props);
    this.state = {
      guids: [],
      singleChecked: true,
      doubleChecked: false
    };
  }

  componentDidMount() {
    this.buildGuids('\'');
  }

  buildGuids = q => {
    this.setState({ guids: [...Array(10)].map((x, i) => <Guid key={i} guid={`${q+uuidv4()+q}`} />)});
  };

  handleGuids = () => {
    let quotes = '';
    if (this.state.singleChecked)
      quotes = '\'';
    else if (this.state.doubleChecked)
      quotes = '"';
    this.buildGuids(quotes);
  }

  handleSingle = e => {
    let quotes = '';
    this.setState({ singleChecked: e.target.checked });
    if (this.state.doubleChecked)
      this.setState({ doubleChecked: false });
    if (e.target.checked)
      quotes = '\'';
    this.buildGuids(quotes);
  }

  handleDouble = e => {
    let quotes = '';
    this.setState({ doubleChecked: e.target.checked });
    if (this.state.singleChecked)
      this.setState({ singleChecked: false });
    if (e.target.checked)
      quotes = '"';
    this.buildGuids(quotes);
  }

  render() {
    return (
      <div>
        <h1>guids</h1>
        <h2>generate</h2>
        {this.state.guids}
        <br/>
        <button onclick={this.handleGuids}>refresh</button>
        {' '}<label for='single'>single</label>
          <input id='single' type='checkbox' checked={this.state.singleChecked} onchange={this.handleSingle}/>
        {' '}<label for='double'>double</label>
          <input id='double' type='checkbox' checked={this.state.doubleChecked} onchange={this.handleDouble} />
        <h2>validate</h2>
        <Validate />
        <a href="https://github.com/schnee72/guidtools">github</a>
      </div>
    );<commit_msg>cleanup<commit_after>import { h, render, Component } from 'preact';
import uuidv4 from 'uuid/v4';
import './index.css';
import Guid from './Guid';
import Validate from './Validate';

class App extends Component {
  constructor(props) {
    super(props);
    this.state = {
      guids: [],
      singleChecked: true,
      doubleChecked: false
    };
  }

  componentDidMount() {
    this.buildGuids('\'');
  }

  buildGuids = q => {
    this.setState({ guids: [...Array(10)].map((x, i) => <Guid key={i} guid={`${q+uuidv4()+q}`} />)});
  };

  handleGuids = () => {
    let quotes = '';
    if (this.state.singleChecked)
      quotes = '\'';
    else if (this.state.doubleChecked)
      quotes = '"';
    this.buildGuids(quotes);
  }

  handleSingle = e => {
    let quotes = '';
    this.setState({ singleChecked: e.target.checked });
    if (this.state.doubleChecked)
      this.setState({ doubleChecked: false });
    if (e.target.checked)
      quotes = '\'';
    this.buildGuids(quotes);
  }

  handleDouble = e => {
    let quotes = '';
    this.setState({ doubleChecked: e.target.checked });
    if (this.state.singleChecked)
      this.setState({ singleChecked: false });
    if (e.target.checked)
      quotes = '"';
    this.buildGuids(quotes);
  }

  render() {
    return (
      <div>
        <h1>guids</h1>
        <h2>generate</h2>
        {this.state.guids}
        <br/>
        <button onclick={this.handleGuids}>reload</button>
        {' '}<label for='single'>'</label>
          <input id='single' type='checkbox' checked={this.state.singleChecked} onchange={this.handleSingle}/>
        {' '}<label for='double'>"</label>
          <input id='double' type='checkbox' checked={this.state.doubleChecked} onchange={this.handleDouble} />
        <h2>validate</h2>
        <Validate />
        <a href="https://github.com/schnee72/guidtools">source</a>
      </div>
    );
{'fraction_non_alphanumeric': 0.18287220026350462, 'fraction_numerical': 0.006851119894598155, 'mean_word_length': 2.6535129932627526, 'pattern_counts': {'":': 0, '<': 45, '<?xml version=': 0, '>': 55, 'https://': 2, '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': '2039546', 'n_tokens_mistral': 1253, 'n_tokens_neox': 1255, 'n_words': 228}