import _extends from "@babel/runtime/helpers/extends";
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
var _excluded = ["context", "accessContext", "testId"];
import React, { useMemo } from 'react';
import { FormattedMessage } from 'react-intl';
import { messages } from '../../../../messages';
import { toMessage } from '../../../../utils/intl-utils';
import UnresolvedView from '../unresolved-view';
import { NotFoundSVG } from './not-found-svg';
var NotFoundView = function NotFoundView(_ref) {
  var context = _ref.context,
    accessContext = _ref.accessContext,
    _ref$testId = _ref.testId,
    testId = _ref$testId === void 0 ? 'embed-card-not-found-view' : _ref$testId,
    unresolvedViewProps = _objectWithoutProperties(_ref, _excluded);
  var _ref2 = context !== null && context !== void 0 ? context : {},
    icon = _ref2.icon,
    image = _ref2.image,
    _ref2$text = _ref2.text,
    text = _ref2$text === void 0 ? '' : _ref2$text;
  var _ref3 = accessContext !== null && accessContext !== void 0 ? accessContext : {},
    titleMessageKey = _ref3.titleMessageKey,
    descriptiveMessageKey = _ref3.descriptiveMessageKey;
  var values = useMemo(function () {
    return {
      product: text
    };
  }, [text]);
  return /*#__PURE__*/React.createElement(UnresolvedView, _extends({}, unresolvedViewProps, {
    icon: icon,
    image: image !== null && image !== void 0 ? image : /*#__PURE__*/React.createElement(NotFoundSVG, null),
    testId: testId,
    text: text,
    title: /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, toMessage(messages.not_found_title, titleMessageKey), {
      values: values
    })),
    description: /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, toMessage(messages.not_found_description, descriptiveMessageKey), {
      values: values
    }))
  }));
};
export default NotFoundView;