UNPKG

@atlaskit/global-search

Version:

A cross-product search component (batteries included)

38 lines (30 loc) 1.38 kB
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral"; var _templateObject; import React from 'react'; import styled from 'styled-components'; import BoardIcon from '@atlaskit/icon/glyph/board'; import IssueIcon from '@atlaskit/icon/glyph/issue'; import FilterIcon from '@atlaskit/icon/glyph/filter'; // AFP-2532 TODO: Fix automatic suppressions below // eslint-disable-next-line @atlassian/tangerine/import/entry-points import { gridSize } from '@atlaskit/theme'; import { ContentType } from '../model/Result'; var IconWrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: ", "px;\n height: ", "px;\n align-items: center;\n display: flex;\n"])), 7 * gridSize() / 2, 7 * gridSize() / 2); var getIconComponent = function getIconComponent(contentType) { switch (contentType) { case ContentType.JiraIssue: return IssueIcon; case ContentType.JiraBoard: return BoardIcon; case ContentType.JiraFilter: return FilterIcon; default: return null; } }; export var getDefaultAvatar = function getDefaultAvatar(contentType) { var IconComponent = getIconComponent(contentType); return IconComponent ? /*#__PURE__*/React.createElement(IconWrapper, null, /*#__PURE__*/React.createElement(IconComponent, { label: contentType || '', size: "medium" })) : null; };