/* NotFoundView.tsx generated by @compiled/babel-plugin v0.38.1 */
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
var _typeof = require("@babel/runtime/helpers/typeof");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
require("./NotFoundView.compiled.css");
var _react = _interopRequireWildcard(require("react"));
var React = _react;
var _runtime = require("@compiled/react/runtime");
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
var _reactIntlNext = require("react-intl-next");
var _lockLocked = _interopRequireDefault(require("@atlaskit/icon/core/lock-locked"));
var _linkExtractors = require("@atlaskit/link-extractors");
var _messages = require("../../../messages");
var _baseTextElement = _interopRequireDefault(require("../../FlexibleCard/components/elements/common/base-text-element"));
var _unresolvedView = _interopRequireDefault(require("./unresolved-view"));
var _withFlexibleUIBlockCardStyle = require("./utils/withFlexibleUIBlockCardStyle");
var _excluded = ["testId"];
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
var textStyles = null;

/**
 * This view represents a Block Card with a 'Not_Found' status.
 *
 * @see SmartLinkStatus
 * @see FlexibleCardProps
 */
var NotFoundView = function NotFoundView(_ref) {
  var _ref$testId = _ref.testId,
    testId = _ref$testId === void 0 ? 'smart-block-not-found-view' : _ref$testId,
    props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
  var intl = (0, _reactIntlNext.useIntl)();
  var details = props.cardState.details;
  var product = (0, _react.useMemo)(function () {
    var _provider$text;
    var provider = (0, _linkExtractors.extractSmartLinkProvider)(details);
    return (_provider$text = provider === null || provider === void 0 ? void 0 : provider.text) !== null && _provider$text !== void 0 ? _provider$text : '';
  }, [details]);
  var title = (0, _react.useMemo)(function () {
    return intl.formatMessage(_messages.messages.not_found_title, {
      product: product
    });
  }, [intl, product]);
  var description = (0, _react.useMemo)(function () {
    return {
      descriptor: _messages.messages.not_found_description
    };
  }, []);
  return /*#__PURE__*/React.createElement(_unresolvedView.default, (0, _extends2.default)({}, props, {
    testId: testId,
    title: title
  }), /*#__PURE__*/React.createElement(_lockLocked.default, {
    label: "not-found-lock-icon",
    color: "var(--ds-icon-danger, #C9372C)",
    testId: "".concat(testId, "-lock-icon")
  }), /*#__PURE__*/React.createElement(_baseTextElement.default, {
    message: description,
    testId: "".concat(testId, "-message"),
    maxLines: 3,
    className: (0, _runtime.ax)(["_syazi7uo"])
  }));
};
var _default = exports.default = (0, _withFlexibleUIBlockCardStyle.withFlexibleUIBlockCardStyle)(NotFoundView);