import React from "react";
import { Button, Input } from "antd";

function getTextSearchProps(dataIndex) {
  let searchInput;
  return {
    onFilter: (value, record) => {
      // Sometimes the values can be undefined so give it a default value.
      const item = record[dataIndex] || "";
      return item
        .toString()
        .toLowerCase()
        .includes(value.trim().toLowerCase());
    },
    onFilterDropdownVisibleChange: visible => {
      if (visible) {
        setTimeout(() => searchInput.select());
      }
    },
    filterDropdown: ({
      setSelectedKeys,
      selectedKeys,
      confirm,
      clearFilters
    }) => (
      <div style={{ padding: 8 }}>
        <Input
          ref={node => {
            searchInput = node;
          }}
          className="t-name-filter"
          placeholder={`Search ${dataIndex}`}
          value={selectedKeys[0]}
          onChange={e =>
            setSelectedKeys(e.target.value ? [e.target.value] : [])
          }
          onPressEnter={() => confirm()}
          style={{ width: 188, marginBottom: 8, display: "block" }}
        />
        <Button
          type="primary"
          className="t-name-filter-ok"
          onClick={() => confirm()}
          icon="search"
          size="small"
          style={{ width: 90, marginRight: 8 }}
        >
          Search
        </Button>
        <Button
          className="t-name-filter-clear"
          onClick={() => clearFilters()}
          size="small"
          style={{ width: 90 }}
        >
          Reset
        </Button>
      </div>
    )
  };
}

export { getTextSearchProps };

@@ -134,277 +134,8 @@
 n %7B%0A
-    onFilter: (value, record) =%3E %7B%0A      // Sometimes the values can be undefined so give it a default value.%0A      const item = record%5BdataIndex%5D %7C%7C %22%22;%0A      return item%0A        .toString()%0A        .toLowerCase()%0A        .includes(value.trim().toLowerCase());%0A    %7D,%0A
     

remove client side filtering option