UNPKG

@atlaskit/tag

Version:

A tag labels UI objects for quick recognition and navigation.

27 lines (25 loc) • 1.16 kB
import React, { Fragment } from 'react'; // Props for the link wrapper // Shared component for conditional link wrapping export function LinkWrapper(_ref) { var isLink = _ref.isLink, href = _ref.href, LinkComponent = _ref.LinkComponent, testId = _ref.testId, children = _ref.children, onClick = _ref.onClick, linkHandlers = _ref.linkHandlers; if (isLink && href) { return /*#__PURE__*/React.createElement(LinkComponent, { href: href, testId: testId ? "".concat(testId, "--link") : undefined, onClick: onClick, onMouseEnter: linkHandlers === null || linkHandlers === void 0 ? void 0 : linkHandlers.onMouseEnter, onMouseLeave: linkHandlers === null || linkHandlers === void 0 ? void 0 : linkHandlers.onMouseLeave, onMouseDown: linkHandlers === null || linkHandlers === void 0 ? void 0 : linkHandlers.onMouseDown, onFocus: linkHandlers === null || linkHandlers === void 0 ? void 0 : linkHandlers.onFocus, onBlur: linkHandlers === null || linkHandlers === void 0 ? void 0 : linkHandlers.onBlur }, children); } return /*#__PURE__*/React.createElement(Fragment, null, children); }