/* ContentContainer.tsx generated by @compiled/babel-plugin v0.40.0 */
import _extends from "@babel/runtime/helpers/extends";
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
var _excluded = ["children", "widthAppearance", "isAIEnabled", "testId", "url"],
  _excluded2 = ["children", "widthAppearance", "isAIEnabled", "testId", "url"];
import "./ContentContainer.compiled.css";
import * as React from 'react';
import { ax, ix } from "@compiled/react/runtime";
import { useEffect, useState } from 'react';
import { di } from 'react-magnetic-di';
import useAISummaryAction from '../../../state/hooks/use-ai-summary-action';
import AIPrism from '../../common/ai-prism';
import { hoverCardClassName } from './HoverCardContent';
var HoverCardContainerStyle = null;
var hoverCardShellWidthDefault = null;
var hoverCardShellWidthSlim = null;
var hoverCardShellHideLoadingPlaceholder = null;
var popupContainerStyles = null;
var ConnectedAIPrismContainer = function ConnectedAIPrismContainer(_ref) {
  var children = _ref.children,
    widthAppearance = _ref.widthAppearance,
    _ref$isAIEnabled = _ref.isAIEnabled,
    isAIEnabled = _ref$isAIEnabled === void 0 ? false : _ref$isAIEnabled,
    testId = _ref.testId,
    url = _ref.url,
    props = _objectWithoutProperties(_ref, _excluded);
  var _useAISummaryAction = useAISummaryAction(url),
    status = _useAISummaryAction.state.status;
  var _useState = useState(status === 'loading'),
    _useState2 = _slicedToArray(_useState, 2),
    showPrism = _useState2[0],
    setShowPrism = _useState2[1];
  useEffect(function () {
    setShowPrism(status === 'loading');
  }, [status]);
  var resolvedWidthAppearance = widthAppearance !== null && widthAppearance !== void 0 ? widthAppearance : 'default';
  var container = /*#__PURE__*/React.createElement("div", _extends({
    // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
    className: ax(["_11q7glyw _189eidpf _vchhusvi", resolvedWidthAppearance === 'slim' ? "_1bsbtye8" : "_1bsb1f23", "_9spsglyw", !isAIEnabled && "_2rko1mok _bfhk1bhr _16qs130s", hoverCardClassName]),
    "data-testid": testId
  }, props), children);
  return isAIEnabled ? /*#__PURE__*/React.createElement(AIPrism, {
    isVisible: showPrism,
    testId: "".concat(testId, "-prism")
  }, container) : container;
};
var ContentContainer = function ContentContainer(_ref2) {
  var children = _ref2.children,
    widthAppearance = _ref2.widthAppearance,
    _ref2$isAIEnabled = _ref2.isAIEnabled,
    isAIEnabled = _ref2$isAIEnabled === void 0 ? false : _ref2$isAIEnabled,
    testId = _ref2.testId,
    url = _ref2.url,
    props = _objectWithoutProperties(_ref2, _excluded2);
  return /*#__PURE__*/React.createElement(ConnectedAIPrismContainer, _extends({
    widthAppearance: widthAppearance,
    isAIEnabled: isAIEnabled,
    url: url,
    testId: testId
  }, props), children);
};
export default ContentContainer;