@atlaskit/global-search
Version:
A cross-product search component (batteries included)
56 lines (44 loc) • 3.09 kB
JavaScript
import _extends from "@babel/runtime/helpers/extends";
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
import _createClass from "@babel/runtime/helpers/createClass";
import _inherits from "@babel/runtime/helpers/inherits";
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
var _templateObject;
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
import React from 'react';
import { FormattedMessage } from 'react-intl';
import Button from '@atlaskit/button/custom-theme-button'; // AFP-2532 TODO: Fix automatic suppressions below
// eslint-disable-next-line @atlassian/tangerine/import/entry-points
import { gridSize, math } from '@atlaskit/theme';
import styled from 'styled-components';
import { messages } from '../messages';
import ErrorImage from '../assets/ErrorImage';
var ErrorWrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n text-align: center;\n margin-top: ", "px;\n"])), math.multiply(gridSize, 4));
var SearchError = /*#__PURE__*/function (_React$Component) {
_inherits(SearchError, _React$Component);
var _super = _createSuper(SearchError);
function SearchError() {
_classCallCheck(this, SearchError);
return _super.apply(this, arguments);
}
_createClass(SearchError, [{
key: "render",
value: function render() {
var onRetryClick = this.props.onRetryClick;
return /*#__PURE__*/React.createElement(ErrorWrapper, null, /*#__PURE__*/React.createElement(ErrorImage, null), /*#__PURE__*/React.createElement("h3", null, /*#__PURE__*/React.createElement(FormattedMessage, messages.search_error_title)), /*#__PURE__*/React.createElement("p", null, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, messages.search_error_body, {
values: {
link: /*#__PURE__*/React.createElement(Button, {
appearance: "link",
spacing: "none",
onClick: onRetryClick
}, /*#__PURE__*/React.createElement(FormattedMessage, messages.search_error_body_link))
}
})))));
}
}]);
return SearchError;
}(React.Component);
export { SearchError as default };