// Copyright 1999-2023. Plesk International GmbH. All rights reserved.

import { useContext } from 'react';
import classNames from 'classnames';
import { CLS_PREFIX } from '../../constants';
import ProgressIndicator from './ProgressIndicator';
import OnDarkContext from '../OnDarkContext';
import { jsx as _jsx } from "react/jsx-runtime";
const ProgressBar = _ref => {
  let {
    baseClassName = `${CLS_PREFIX}progress-bar`,
    className,
    intent,
    progress = -1,
    ...props
  } = _ref;
  return /*#__PURE__*/_jsx("div", {
    className: classNames(baseClassName, {
      [`${baseClassName}--on-dark`]: useContext(OnDarkContext)
    }, className),
    "aria-valuemin": 0,
    "aria-valuemax": 100,
    "aria-valuenow": progress >= 0 && progress <= 100 ? progress : undefined,
    role: "progressbar",
    ...props,
    children: /*#__PURE__*/_jsx(ProgressIndicator, {
      intent: intent,
      progress: progress
    })
  });
};
export default ProgressBar;