render()

in ui/src/client/components/common/components/Selector/Selector.js [119:166]


  render() {
    const {
      options = [],
      className,
      placeholder,
      selectedOption,
      onClear,
      buttonHeight,
      buttonClassName,
      optionHeigth,
      offsetOptions,
      arrowComponent,
      clearComponent,
      optionsComponent,
      isClearIcon,
    } = this.props;
    if (!options) {
      return null;
    }
    const { isOpen } = this.state;
    const CustomArrowComponent = arrowComponent;
    const CustomClearComponent = clearComponent;
    const CustomOptionsComponent = optionsComponent;
    return (
      <div
        className={`dh-selector ${className}`}
        ref={(ref) => { this.selector = ref; }}
      >

        <button
          style={{ height: `${buttonHeight}px` }}
          className={buttonClassName || ''}
          type="button"
          onClick={this.handleToogleSelector}
        >
          <span>
            {this.getSelectedValue() || placeholder}
          </span>
          <CustomArrowComponent isOpen={isOpen} />
          {
            this.isHaveSelected() && isClearIcon && (
            <CustomClearComponent handleClear={(e) => {
              e.stopPropagation();
              onClear();
            }}
            />
            )
          }