/* NotFoundView.tsx generated by @compiled/babel-plugin v0.40.0 */
import _extends from "@babel/runtime/helpers/extends";
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
var _excluded = ["testId"];
import "./NotFoundView.compiled.css";
import * as React from 'react';
import { ax, ix } from "@compiled/react/runtime";
import { useMemo } from 'react';
import { useIntl } from 'react-intl';
import LockLockedIcon from '@atlaskit/icon/core/lock-locked';
import { extractSmartLinkProvider } from '@atlaskit/link-extractors';
import { messages } from '../../../messages';
import Text from '../../FlexibleCard/components/elements/common/base-text-element';
import UnresolvedView from './unresolved-view';
import { withFlexibleUIBlockCardStyle } from './utils/withFlexibleUIBlockCardStyle';
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 = _objectWithoutProperties(_ref, _excluded);
  var intl = useIntl();
  var details = props.cardState.details;
  var product = useMemo(function () {
    var _provider$text;
    var provider = extractSmartLinkProvider(details);
    return (_provider$text = provider === null || provider === void 0 ? void 0 : provider.text) !== null && _provider$text !== void 0 ? _provider$text : '';
  }, [details]);
  var title = useMemo(function () {
    return intl.formatMessage(messages.not_found_title, {
      product: product
    });
  }, [intl, product]);
  var description = useMemo(function () {
    return {
      descriptor: messages.not_found_description
    };
  }, []);
  return /*#__PURE__*/React.createElement(UnresolvedView, _extends({}, props, {
    testId: testId,
    title: title
  }), /*#__PURE__*/React.createElement(LockLockedIcon, {
    label: "not-found-lock-icon",
    color: "var(--ds-icon-danger, #C9372C)",
    testId: "".concat(testId, "-lock-icon")
  }), /*#__PURE__*/React.createElement(Text, {
    message: description,
    testId: "".concat(testId, "-message"),
    maxLines: 3,
    className: ax(["_syazi7uo"])
  }));
};
var _default_1 = withFlexibleUIBlockCardStyle(NotFoundView);
export default _default_1;