UNPKG

@atlaskit/global-search

Version:

A cross-product search component (batteries included)

46 lines (34 loc) 2.48 kB
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 styled from 'styled-components'; // AFP-2532 TODO: Fix automatic suppressions below // eslint-disable-next-line @atlassian/tangerine/import/entry-points import { gridSize, math } from '@atlaskit/theme'; import NoResultsImage from '../assets/NoResultsImage'; var NoResultsWrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n text-align: center;\n margin-top: ", "px;\n margin-bottom: 0;\n"])), math.multiply(gridSize, 15)); var NoResults = /*#__PURE__*/function (_React$Component) { _inherits(NoResults, _React$Component); var _super = _createSuper(NoResults); function NoResults() { _classCallCheck(this, NoResults); return _super.apply(this, arguments); } _createClass(NoResults, [{ key: "render", value: function render() { var _this$props = this.props, title = _this$props.title, body = _this$props.body; return /*#__PURE__*/React.createElement(NoResultsWrapper, null, /*#__PURE__*/React.createElement(NoResultsImage, null), /*#__PURE__*/React.createElement("h3", null, title), body && /*#__PURE__*/React.createElement("p", null, body)); } }]); return NoResults; }(React.Component); export { NoResults as default };