@atlaskit/tag
Version:
A tag labels UI objects for quick recognition and navigation.
36 lines (34 loc) • 1.39 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({
isLink,
href,
LinkComponent,
testId,
children,
onClick,
linkHandlers
}) {
if (isLink && href) {
return /*#__PURE__*/React.createElement(LinkComponent, {
href: href,
testId: testId ? `${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);
}