import { ReactElement } from 'react';
import Select, { SelectProps } from './SingleSelect';
import MultiSelect from './MultiSelect';
import { BaseOption } from './types';

type CompoundSelectComponent = (<T extends BaseOption>(
  props: SelectProps<T>
) => ReactElement) & { Multi: typeof MultiSelect };

const CompoundSelect = Select as CompoundSelectComponent;

CompoundSelect.Multi = MultiSelect;

export default CompoundSelect;
