import React from 'react';
import type { ReactElement } from 'react';
import List from '../../List';

const Option = ({
  text,
  disabled = false,
  selected,
  onPress,
  highlighted = false,
}: {
  text: string | ReactElement;
  disabled?: boolean;
  selected: boolean;
  onPress: () => void;
  highlighted?: boolean;
}) => {
  const props = {
    selected,
    disabled,
    onPress,
    title: text,
  };
  return highlighted === true ? (
    <List.Item {...props} />
  ) : (
    <List.BasicItem {...props} />
  );
};

export default Option;
