import { IOption } from '@websolutespa/bom-core';
import { createContext, FocusEvent } from 'react';
import { comboboxVariants, IComboboxVariants } from './combobox.variants';

export type ComboboxContextProps = {
  name?: string;
  label?: string;
  value?: string | IOption | null;
  defaultValue?: string | IOption | null;
  options?: IOption[];
  multiple?: boolean;
  variant?: keyof typeof comboboxVariants | (string & {});
  variants?: IComboboxVariants;
  onFocus: (event: FocusEvent<HTMLInputElement>) => void;
  onBlur: (event: FocusEvent<HTMLInputElement>) => void;
};

export const ComboboxContext = createContext<ComboboxContextProps | null>(null);
