"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _react = require("react");
var _classnames = _interopRequireDefault(require("classnames"));
var _constants = require("../../constants");
var _jsxRuntime = require("react/jsx-runtime");
// Copyright 1999-2023. Plesk International GmbH. All rights reserved.

/**
 * Auxiliary Actions component is used for executing additional (not primary) actions.
 * @since 0.4.1
 */
const AuxiliaryActions = _ref => {
  let {
    baseClassName = `${_constants.CLS_PREFIX}auxiliary-actions`,
    className,
    separator = /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
      className: `${baseClassName}__separator`,
      children: ' | '
    }),
    children,
    ...props
  } = _ref;
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
    className: (0, _classnames.default)(baseClassName, className),
    ...props,
    children: _react.Children.toArray(children).reduce((accu, elem, index) => accu.length === 0 ? [elem] : [...accu, /*#__PURE__*/(0, _react.isValidElement)(separator) ? /*#__PURE__*/(0, _react.cloneElement)(separator, {
      key: index
    }) // eslint-disable-line react/no-array-index-key
    : separator, elem], [])
  });
};
var _default = exports.default = AuxiliaryActions;