import {State} from "@hookstate/core";
import {Filters} from "../models/game";

export const ChangeActiveFilterHeader = (
    filters: Filters,
    searchParams: string,
    setShowFiltersModuleState: State<boolean>
) => {
  if (
      searchParams.length > 0 ||
      filters.series.length > 0 ||
      filters.playStatus.length > 0 ||
      filters.genre.length > 0 ||
      filters.os.length > 0 ||
      filters.store.length > 0 ||
      filters.developer.length > 0 ||
      filters.publisher.length > 0 ||
      filters.controller.length > 0 ||
      filters.soundtrack.length > 0 ||
      filters.intel.length > 0 ||
      filters.wine.length > 0 ||
      filters.rating.length > 0
  ) setShowFiltersModuleState.set(true)
  else setShowFiltersModuleState.set(false)
}
