"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = StaticTabularDataTooltip;
var _react = _interopRequireDefault(require("react"));
var _server = require("react-dom/server");
var _tabularDataTooltip = _interopRequireDefault(require("./tabular-data-tooltip"));
var _jsxRuntime = require("react/jsx-runtime");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
/* eslint-disable no-console */

const errorMessage = 'Warning: useLayoutEffect does nothing on the server';
function StaticTabularDataTooltip(title, rows, {
  testId,
  className,
  footer
} = {}) {
  const consoleError = console.error;
  // This is done to suppress React warnings about useLayoutEffect. It is
  // considered safe here because function is synchronous, and we restore the
  // original function immediately after render.
  console.error = (error, ...args) => {
    if (error && error.includes(errorMessage)) {
      return;
    }
    return consoleError(error, ...args);
  };
  const view = (0, _server.renderToStaticMarkup)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_tabularDataTooltip.default, {
    title: title,
    rows: rows,
    testId: testId,
    footer: footer,
    className: className
  }));
  console.error = consoleError;
  return view;
}