import Balloon from '../balloon/index';
import ConfigProvider from '../config-provider';
import React, { Component } from 'react';
import cls from 'classnames';
import { Step as NextStep } from '@alifd/next';
class StepItem extends Component {
    render() {
        const { prefix = 'next-', error, icon, className, info } = this.props;
        if (info) {
            return (React.createElement(Balloon, { trigger: React.createElement(NextStep.Item, Object.assign({}, this.props, { className: cls(className, {
                        [`${prefix}step-error`]: error,
                        [`${prefix}step-self-icon`]: icon,
                    }) })), align: "bl", type: "dark", alignEdge: true }, info));
        }
        return (React.createElement(NextStep.Item, Object.assign({}, this.props, { className: cls(className, {
                [`${prefix}step-error`]: error,
                [`${prefix}step-self-icon`]: icon,
            }) })));
    }
}
class Step extends Component {
    render() {
        const { prefix = 'next-', className, size = 'medium', shape = 'circle', labelPlacement } = this.props;
        return (React.createElement(NextStep, Object.assign({}, this.props, { shape: shape, labelPlacement: shape === 'circle' ? (labelPlacement === 'ver' ? 'ver' : 'hoz') : 'ver', 
            // dot模式下强制设置为 ver，circle模式下设置默认为hoz，自定义图标的一般设置为ver（设计稿，用户自己去设置），hoz情况下的样式也没有问题
            className: cls(className, {
                [`${prefix}small`]: size === 'small',
                [`${prefix}medium`]: size === 'medium',
            }) })));
    }
}
Step.Item = ConfigProvider.config(StepItem);
export default ConfigProvider.config(Step);
