import { useContext } from 'react';
import { SharedFilterContext } from '../contexts/sharedFilterState';
import type { SharedFilterState } from '../contexts/sharedFilterState';

export type { SharedFilterState };

export function useSharedFilters(): SharedFilterState {
  const ctx = useContext(SharedFilterContext);
  if (!ctx) throw new Error('useSharedFilters must be inside SharedFilterProvider');
  return ctx;
}
