import React from 'react';
import { CnFilter as CnFilterView } from './filter-view';

class CnFilter extends React.Component {
  constructor(props) {
    super(props);
    this.ref = React.createRef();
  }

  reset = () => {
    this.ref?.current?.reset?.();
  };

  getFormInstance = () => {
    return this.ref?.current?.getFormInstance?.();
  };

  search = () => {
    this.ref?.current?.search?.();
  };

  render() {
    return <CnFilterView ref={this.ref} {...this.props} />;
  }
}
CnFilter.displayName = 'CnFilter';
export default CnFilter;

export { CnFilter };
