"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.makeStyledComponent = void 0;

var _useStyledSystemPropsResolver = require("../hooks/useStyledSystemPropsResolver");

var _react = _interopRequireDefault(require("react"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }

const makeStyledComponent = Comp => // componentName: keyof ITheme['components']
{
  //TODO: component theme
  // return <> </>;
  // const globalLightStyle = getStyledComponent(componentName, 'light');
  // const globalDarkStyle = getStyledComponent(componentName, 'dark');
  // console.log(StyleSheet.flatten(globalLightStyle.style), 'hello style');
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  return /*#__PURE__*/_react.default.forwardRef(({
    debug,
    ...props
  }, ref) => {
    const [styleSheet, restProps] = (0, _useStyledSystemPropsResolver.useStyledSystemPropsResolver)(props);
    return /*#__PURE__*/_react.default.createElement(Comp, _extends({}, restProps, {
      style: styleSheet,
      ref: ref
    }), props.children);
  });
};

exports.makeStyledComponent = makeStyledComponent;
//# sourceMappingURL=makeStyledComponent.js.map