import * as React from 'react'; // import {isString} from 'lodash'; // import * as uuidv4 from 'uuid/v4' import RenderHtml from '../renderFunction'; import PropsTypes from './types'; import classNames from "classnames"; export default class Button extends React.Component { // private button = React.createRef(); constructor(props: PropsTypes, {}) { super(props); } handleClick = () => { const {disabled} = this.props; if (disabled) { return } this.props.onClick && this.props.onClick() }; renderTypeRender() { const {type, text, icon, size, color, outline, disabled, active, loading, fluid, inverted, rounded, customStyle} = this.props; const uiClass = classNames(`krax-button is-${size || 'default'} is-${color || 'default'} ${customStyle || ''}`, { 'is-fullwidth': fluid, 'is-outlined': outline, 'is-inverted': inverted, 'is-rounded': rounded, 'disabled': disabled, 'active': active, 'is-loading': loading }); if (type === 'a') { return this.handleClick()} > {RenderHtml.renderIcon(icon, 'left')} {text ? {text} : null} {RenderHtml.renderIcon(icon, 'right')} } return } public render(): JSX.Element { return this.renderTypeRender(); } }