content: import '../css/index.css';
  import React from 'react';
  
  import SearchBar from './SearchBar';
  import ProductTable from './ProductTable';
  
  class FilterableProductTable extends React.Component {
      constructor (props) {
          super(props);
          this.state = {
              isStockOnly: false,
              filterText: ''
          };
      }
  
      handleCheckboxClick = (e) => {
          this.setState({
              isStockOnly: e.target.checked
          })
      }
  
      handleInputChange = (e) => {
          this.setState({
              filterText: e.target.value
          });
      }
  
      render () {
          const { products } = this.props;
          const { isStockOnly, filterText } = this.state;
  
          return <div className="product">
              <SearchBar 
                  onCbClick={this.handleCheckboxClick} 
                  onInputChange = { this.handleInputChange }/>
              <ProductTable 
                  products={products} 
                  filterText={ filterText } 
                  isStockOnly={ isStockOnly }/>
          </div>
      }
  }
  export default FilterableProductTable