/* ContentContainer.tsx generated by @compiled/babel-plugin v0.39.1 */
import _extends from "@babel/runtime/helpers/extends";
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';
const HoverCardContainerStyle = null;
const hoverCardShellWidthDefault = null;
const hoverCardShellWidthSlim = null;
const hoverCardShellHideLoadingPlaceholder = null;
const popupContainerStyles = null;
const ConnectedAIPrismContainer = ({
  children,
  widthAppearance,
  isAIEnabled = false,
  testId,
  url,
  ...props
}) => {
  const {
    state: {
      status
    }
  } = useAISummaryAction(url);
  const [showPrism, setShowPrism] = useState(status === 'loading');
  useEffect(() => {
    setShowPrism(status === 'loading');
  }, [status]);
  const resolvedWidthAppearance = widthAppearance !== null && widthAppearance !== void 0 ? widthAppearance : 'default';
  const 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' ? "_1bsbiolt" : "_1bsb1f23", "_9spsglyw", !isAIEnabled && "_2rko1mok _bfhk1bhr _16qs130s", hoverCardClassName]),
    "data-testid": testId
  }, props), children);
  return isAIEnabled ? /*#__PURE__*/React.createElement(AIPrism, {
    isVisible: showPrism,
    testId: `${testId}-prism`
  }, container) : container;
};
const ContentContainer = ({
  children,
  widthAppearance,
  isAIEnabled = false,
  testId,
  url,
  ...props
}) => /*#__PURE__*/React.createElement(ConnectedAIPrismContainer, _extends({
  widthAppearance: widthAppearance,
  isAIEnabled: isAIEnabled,
  url: url,
  testId: testId
}, props), children);
export default ContentContainer;