import React from 'react';

export const ComponentWithoutProps = (
  Component: React.ComponentType<any>,
  filters: string[]
) => (props: any) => {
  const filteredProps = Object.keys(props).reduce((acc: any, prop) => {
    if (filters.indexOf(prop) === -1) {
      acc[prop] = props[prop];
    }
    return acc;
  }, {});
  return <Component {...filteredProps} />;
};
