import ConfigProvider from '../config-provider';
import React, { Component } from 'react';
import cls from 'classnames';
// import hoistNonReactStatics from 'hoist-non-react-statics';
import { Progress as NextProgress } from '@alifd/next';
import { ProgressProps as NextProgressProps } from '@alifd/next/types/progress';

interface ProgressProps extends NextProgressProps {
  strokeSize?: 'bold' | 'medium' | 'thin';
}
class Progress extends Component<ProgressProps> {

  render() {
    const { prefix = 'next-', className, ...otherProps } = this.props;
    const { shape } = this.props;
    if (shape === 'circle') {
      const { strokeSize = 'medium', prefix = 'next-', className, ...otherProps } = this.props;
      return (
        <NextProgress
          {...otherProps}
          prefix={prefix}
          className={cls(className, {
            [`${prefix}bold`]: strokeSize === 'bold',
            [`${prefix}medium`]: strokeSize === 'medium',
            [`${prefix}thin`]: strokeSize === 'thin',
          })}
        />
      );
    }
    return (
      <NextProgress
        {...otherProps}
        prefix={prefix}
        className={cls(className, {
        })}
      />
    );
  }
}

// hoistNonReactStatics(Radio, NextRadio);

export default ConfigProvider.config(Progress);
