/* NotFoundView.tsx generated by @compiled/babel-plugin v0.38.1 */
import _extends from "@babel/runtime/helpers/extends";
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-next';
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';
const textStyles = null;

/**
 * This view represents a Block Card with a 'Not_Found' status.
 *
 * @see SmartLinkStatus
 * @see FlexibleCardProps
 */
const NotFoundView = ({
  testId = 'smart-block-not-found-view',
  ...props
}) => {
  const intl = useIntl();
  const {
    cardState: {
      details
    }
  } = props;
  const product = useMemo(() => {
    var _provider$text;
    const provider = extractSmartLinkProvider(details);
    return (_provider$text = provider === null || provider === void 0 ? void 0 : provider.text) !== null && _provider$text !== void 0 ? _provider$text : '';
  }, [details]);
  const title = useMemo(() => intl.formatMessage(messages.not_found_title, {
    product
  }), [intl, product]);
  const description = useMemo(() => ({
    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: `${testId}-lock-icon`
  }), /*#__PURE__*/React.createElement(Text, {
    message: description,
    testId: `${testId}-message`,
    maxLines: 3,
    className: ax(["_syazi7uo"])
  }));
};
export default withFlexibleUIBlockCardStyle(NotFoundView);