import React from 'react';
import PropTypes from 'prop-types';

const createExport = (data) => {
  // Tehtäväluokka – käsittelyvaihe – toimenpide – asiakirja
  //    - attributes
  // Do something with the data...
};

const Exporter = ({ data }) => {
  return (
    <button className='btn btn-primary' onClick={() => createExport(data)}>Export</button>
  );
};

Exporter.propTypes = {
  data: PropTypes.object
};

export default Exporter;

@@ -244,16 +244,74 @@
 %7D) =%3E %7B%0A
+  const countStr = data.length %3E 1 ? 'tulosta' : 'tulos';%0A
   return
@@ -388,22 +388,81 @@
 (data)%7D%3E
-Export
+Vie %7Bdata.length%7D %7BcountStr%7D %3Ci className='fa fa-file-excel-o' /%3E
 %3C/button
@@ -517,14 +517,13 @@
 pes.
-object
+array
 %0A%7D;%0A

Introduce exporter-component