import './withSkeleton_tz8f43.css';
import { objectWithoutProperties as _objectWithoutProperties, objectSpread2 as _objectSpread2 } from '../../../_virtual/_rollupPluginBabelHelpers.js';
import React__default from 'react';
import { styled } from '@linaria/react';
import cls from 'classnames';
import { classes } from '../tokens.js';

var _excluded = ["skeleton", "animationType", "className"];
/**
 * Делает компонент скелетоном - у него заменяется фоновый цвет,
 * добавляется градиент и текст становится на 100% прозрачным.
 */

var withSkeleton = function withSkeleton(Component) {
  return function (_ref) {
    var skeleton = _ref.skeleton,
      _ref$animationType = _ref.animationType,
      animationType = _ref$animationType === void 0 ? 'shimmer' : _ref$animationType,
      className = _ref.className,
      props = _objectWithoutProperties(_ref, _excluded);
    var animationClass = classes["".concat(animationType, "Animation")];
    var skeletonClass = skeleton ? 'apply-skeleton-gradient' : undefined;
    var Wrapper = /*#__PURE__*/styled('div')({
      name: "Wrapper",
      "class": "wkvmjj8",
      propsAsIs: false
    });
    var componentProps = _objectSpread2(_objectSpread2({}, props), {}, {
      className: cls(skeletonClass, animationClass, className)
    });
    return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Wrapper, null, /*#__PURE__*/React__default.createElement(Component, componentProps)));
  };
};

export { withSkeleton };
//# sourceMappingURL=withSkeleton.js.map
