import { IOption } from '@websolutespa/bom-core';
import { createContext, FocusEvent } from 'react';
import { ISelectVariants, selectVariants } from './select.variants';

export type SelectContextProps = {
  name: string;
  label?: string;
  options?: IOption[];
  multiple?: boolean;
  placeholder?: string;
  variant?: keyof typeof selectVariants | (string & {});
  variants?: ISelectVariants;
  onFocus: (event: FocusEvent<HTMLButtonElement>) => void;
  onBlur: (event: FocusEvent<HTMLButtonElement>) => void;
};

export const SelectContext = createContext<SelectContextProps | null>(null);
