import * as React from 'react';
import classNames from 'classnames';
import ContentAnalyticsErrorState from './ContentAnalyticsErrorState';
import ContentInsightsSummaryGhostState from './ContentInsightsSummaryGhostState';
import GraphCardPreviewsSummary from './GraphCardPreviewsSummary';
import OpenContentInsightsButton from './OpenContentInsightsButton';
import './ContentInsightsSummary.scss';
const ContentInsightsSummary = ({
  error,
  graphData,
  isLoading,
  isRedesignEnabled,
  onClick,
  previousPeriodCount,
  totalCount
}) => {
  const renderContentAnalyticsSummary = () => {
    if (error) {
      return /*#__PURE__*/React.createElement(ContentAnalyticsErrorState, {
        error: error
      });
    }
    if (isLoading) {
      return /*#__PURE__*/React.createElement(ContentInsightsSummaryGhostState, null);
    }
    return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(GraphCardPreviewsSummary, {
      graphData: graphData,
      isRedesignEnabled: isRedesignEnabled,
      previousPeriodCount: previousPeriodCount,
      totalCount: totalCount
    }), /*#__PURE__*/React.createElement(OpenContentInsightsButton, {
      onClick: onClick,
      isRedesignEnabled: isRedesignEnabled
    }));
  };
  return /*#__PURE__*/React.createElement("div", {
    className: classNames('ContentInsightsSummary', {
      'ContentInsightsSummary--redesigned': isRedesignEnabled
    })
  }, renderContentAnalyticsSummary());
};
export default ContentInsightsSummary;
//# sourceMappingURL=ContentInsightsSummary.js.map