// @flow import React from 'react'; import type { Element, ElementRef } from 'react'; // external libraries import classnames from 'classnames'; // components import { Options } from '../../components/Options'; import { Input } from '../../components/Input'; // skins import { OptionsSkin } from './OptionsSkin'; import { InputSkin } from './InputSkin'; type Props = { className: string, disabled?: boolean, error: string | Element, getSelectedOption: Function, handleChange: Function, handleInputClick: Function, hasSearch?: boolean, hideSearchClearButton?: boolean, highlightSearch?: boolean, inputRef: ElementRef<'input'>, isOpen: boolean, isOpeningUpward: boolean, label: string | Element, noResultsMessage?: string, onBlur: Function, onChange: Function, onFocus: Function, onSearch?: Function, options: Array<{ isDisabled: boolean, value: any, }>, optionRenderer: Function, optionsRef: ElementRef, optionsMaxHeight: number, placeholder: string, rootRef: ElementRef<*>, selectionRenderer?: Function, theme: Object, // will take precedence over theme in context if passed themeId: string, toggleOpen: Function, toggleMouseLocation: Function, value: string, optionHeight: ?number, searchHeight: ?number, }; export const SelectSkin = (props: Props) => { const selectedOption = props.getSelectedOption(); const inputValue = selectedOption ? selectedOption.label : ''; const { theme, themeId } = props; return (
); };