import { createContext, ReactNode, useContext } from 'react';
import { FilterElement } from '../CollectionToolbarFilters';
import { SlidingModalProps } from '../SlidingModal';

export interface IFiltersPanelContext {
  filters: FilterElement[];
  className?: SlidingModalProps['className'];
  title?: string | ReactNode;
  onClearButtonClicked?: () => unknown;
}

export const FiltersPanelContext = createContext<IFiltersPanelContext>({
  filters: [],
});
export const useFiltersPanelContext = () => useContext(FiltersPanelContext);
