import {FlatListProps, BlurEvent} from 'react-native';
import {IconName} from '@components/Icon';
import {InputContainerProps} from '@components/InputContainer';

export type SelectValue = number | string;

export type SelectOption = {
  id: SelectValue;
  name: string;
  icon?: IconName;
  answered?: boolean;
  reviewerId?: number;
};

export interface SelectInputProps<T = SelectOption>
  extends Omit<InputContainerProps, 'children'> {
  variant?: 'checkbox' | 'button';
  value: Nullable<SelectValue>;
  setSelectedValue: (value: SelectValue) => void;
  placeholder?: string;
  options: T[];
  disabled?: boolean;
  filterable?: boolean;
  modalSearchPlaceholder?: string;
  onBlur?: (e?: BlurEvent) => void;
  onEndReached?: FlatListProps<T>['onEndReached'];
  isLoading?: boolean;
  showClearButton?: boolean;
  onClear?: () => void;
  autocompleteUniqueOption?: boolean;
  modalTitle?: string;
  checkboxColor?: string;
}
