import { createContext, useContext } from 'react';

import { type FormIndividualSelectionProps } from '@composed-components/audience/IndividualSelection/types';

export const IndividualCriteriaContext = createContext<
  FormIndividualSelectionProps['inputProps'] | null
>(null);

export const IndividualCriteriaProvider = IndividualCriteriaContext.Provider;

export const useIndividualCriteriaContext = () =>
  useContext(IndividualCriteriaContext);
