<commit_before>import fs from 'fs';
import path from 'path';
import React from 'react';
import PropTypes from 'prop-types';
import Link from 'component/link';
import parseData from 'util/parseData';
import * as icons from 'constants/icons';
const { remote } = require('electron');

class FileExporter extends React.PureComponent {
  static propTypes = {
    data: PropTypes.array,
    type: PropTypes.oneOf(['json', 'csv']),
    title: PropTypes.string,
    label: PropTypes.string,
    defaultPath: PropTypes.string,
    onFileCreated: PropTypes.func,
  };

  static defaultProps = {
    type: 'json',
  };

  constructor(props) {
    super(props);
  }

  handleFileCreation(filename, data) {
    const { onFileCreated } = this.props;
    fs.writeFile(filename, data, err => {
      if (err) throw err;
      // Do something after creation
      onFileCreated && onFileCreated(filename);
    });
  }

  handleButtonClick() {
    const { title, defaultPath, data } = this.props;

    const options = {
      title,
      defaultPath,
      filters: [{ name: 'JSON', extensions: ['json'] }, { name: 'CSV', extensions: ['csv'] }],
    };
<commit_msg>remove type from component props<commit_after>import fs from 'fs';
import path from 'path';
import React from 'react';
import PropTypes from 'prop-types';
import Link from 'component/link';
import parseData from 'util/parseData';
import * as icons from 'constants/icons';
const { remote } = require('electron');

class FileExporter extends React.PureComponent {
  static propTypes = {
    data: PropTypes.array,
    title: PropTypes.string,
    label: PropTypes.string,
    defaultPath: PropTypes.string,
    onFileCreated: PropTypes.func,
  };

  constructor(props) {
    super(props);
  }

  handleFileCreation(filename, data) {
    const { onFileCreated } = this.props;
    fs.writeFile(filename, data, err => {
      if (err) throw err;
      // Do something after creation
      onFileCreated && onFileCreated(filename);
    });
  }

  handleButtonClick() {
    const { title, defaultPath, data } = this.props;

    const options = {
      title,
      defaultPath,
      filters: [{ name: 'JSON', extensions: ['json'] }, { name: 'CSV', extensions: ['csv'] }],
    };

{'fraction_non_alphanumeric': 0.13327330031517334, 'fraction_numerical': 0.0, 'mean_word_length': 3.435129740518962, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '4318969', 'n_tokens_mistral': 658, 'n_tokens_neox': 659, 'n_words': 185}