@atlaskit/tag
Version:
A tag labels UI objects for quick recognition and navigation.
35 lines (33 loc) • 1.53 kB
JavaScript
/* link-wrapper-2.tsx generated by @compiled/babel-plugin v3.0.2 */
/**
* Shared utilities for TagNew and AvatarTag components.
* Note: CSS styles cannot be shared due to Compiled CSS static analysis requirements.
*/
import * as React from 'react';
import { ax, ix } from "@compiled/react/runtime";
import { Fragment } from 'react';
// Props for the link wrapper
// Shared component for conditional link wrapping
// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
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);
}