import React from 'react';
import Line from './Line';
import Circle from './Circle';
import { IProgress } from './types';
import theme from 'styles/theme';

export const Progress: React.FC<IProgress> = ({ type = 'line', colors = [theme.brand], ...rest }) => {
    switch (type) {
        case 'line':
            return <Line colors={colors} {...rest} />;
        case 'circle':
            return <Circle colors={colors} {...rest} />;
        default:
            throw new Error('Progress只支持 line 和 circle 两种 type，传入的 type 值为 ' + type);
    }
};

export default React.memo(Progress);
