Skip to content
Snippets Groups Projects
hellerauFacets.js 785 B
Newer Older
esikkala's avatar
esikkala committed
import { handleFacetAction } from '../general/facets'

export const INITIAL_STATE = {
  updatedFacet: null,
  facetUpdateID: 0,
  updatedFilter: null,
  facets: {
    prefLabel: {
      id: 'prefLabel',
      // predicate: defined in backend
      distinctValueCount: 0,
      values: [],
      flatValues: [],
      sortBy: null,
      sortDirection: null,
      sortButton: false,
      spatialFilterButton: false,
      isFetching: false,
      searchField: false,
      containerClass: 'one',
      filterType: 'textFilter',
      textFilter: null,
      priority: 1
    }
  }
}

const hellerauFacets = (state = INITIAL_STATE, action) => {
  if (action.facetClass === 'hellerau') {
    return handleFacetAction(state, action)
  } else return state
}

export default hellerauFacets