import React from 'react';
import Down from '@beisen-phoenix/icon/lib/down';
import { $M4 } from '@beisen-phoenix/style-token';
import utils from '@beisen-phoenix/common-utils';
const classes = utils.BEMClass('select');
import './index.scss';
interface SwitchArrowProps {
  onClick?: Function;
  disabled?: boolean;
  adjustArrow?: boolean
  hide?: boolean
  suffix?: React.ReactNode;
}

export default class SwitchArrow extends React.PureComponent<SwitchArrowProps, any> {
  render() {
    let { onClick, disabled, adjustArrow,hide,suffix} = this.props;
    suffix = suffix || <Down color={disabled ? $M4 : ''} />
    return (
      <div
        className={classes({element: 'switchArrow',modifiers: {disabled, adjustArrow,hide}})}
        onClick={e => {
          !disabled && onClick && onClick();
          // e.stopPropagation && e.stopPropagation();
        }}
      >
        {suffix}
      </div>
    );
  }
}
