import React from "react";
import cn from "classnames";
import PropTypes from "prop-types";

interface IProgressProps {
  height?: number;
  className?: string;
  children?: React.ReactNode | React.ReactNode[];
  ["data-testid"]?: string;
}

const Progress: React.FC<IProgressProps> = props => {
  const { height, className, children } = props;
  const testId = props["data-testid"] || "honeyui-progress";

  return (
    <div className={cn("progress", className)} style={{ height }} data-testid={testId}>
      {children}
    </div>
  );
};

Progress.displayName = "Progress";

Progress.propTypes = {
  height: PropTypes.number,
  className: PropTypes.string,
  children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node])
};

export default Progress;
