import {FilterType} from "../../../../generated/ru/micord/ervu/property/grid/FilterType";
import {DateFilter, NumberFilter, TextFilter} from "ag-grid-community";
import {SetFilter} from "./SetFilter";
import {FileAvailableFilterComp} from "./FileAvailableFilterComp";

export class CustomGridColumnFilterUtils {

  public static columnFilter(type: FilterType) {
    if (!type) {
      return null;
    }

    switch (type) {
      case FilterType.NUMBER:
        return NumberFilter;
      case FilterType.DATE:
        return DateFilter;
      case FilterType.SET:
        return SetFilter;
      case FilterType.FILE:
        return FileAvailableFilterComp;
      case FilterType.TEXT:
      default:
        return TextFilter;
    }
  }
}
