import React from 'react';

import { FilterValues } from './types';
import OriginalFilter, { FilterProps } from './Filter';
import OriginalFilters, { FiltersProps } from './Filters';

const createFilters = <T extends FilterValues>() => {
  const Filters = (props: FiltersProps<T>) => {
    return <OriginalFilters {...props} />;
  };

  const Filter = <K extends keyof T>(props: FilterProps<T, K>) => {
    return <OriginalFilter {...props} />;
  };

  return {
    Filters,
    Filter,
  };
};

export default createFilters;
