@atlaskit/profilecard
Version:
A React component to display a card with user information.
61 lines • 2.31 kB
JavaScript
/* main.tsx generated by @compiled/babel-plugin v0.39.1 */
import "./main.compiled.css";
import { ax, ix } from "@compiled/react/runtime";
import React, { useCallback } from 'react';
import { LinkItem } from '@atlaskit/menu';
import { Box, Inline, Text } from '@atlaskit/primitives/compiled';
import { useAnalyticsEvents } from '@atlaskit/teams-app-internal-analytics';
import { ContainerIcon, getContainerProperties } from '@atlaskit/teams-public';
var styles = {
containerTypeIconButtonStyles: "_18u01wug _4t3i7vkz _1bsb7vkz"
};
export var TeamConnections = function TeamConnections(_ref) {
var containerType = _ref.containerType,
title = _ref.title,
containerIcon = _ref.containerIcon,
link = _ref.link;
var _getContainerProperti = getContainerProperties({
containerType: containerType,
iconSize: 'medium',
isDisplayedOnProfileCard: true
}),
description = _getContainerProperti.description,
icon = _getContainerProperti.icon,
containerTypeText = _getContainerProperti.containerTypeText;
var _useAnalyticsEvents = useAnalyticsEvents(),
fireEvent = _useAnalyticsEvents.fireEvent;
var onClick = useCallback(function () {
fireEvent('ui.teamConnectionItem.clicked.teamProfileCard', {
container: containerType
});
}, [containerType, fireEvent]);
return /*#__PURE__*/React.createElement(LinkItem, {
href: link,
onClick: onClick,
target: "_blank",
description: /*#__PURE__*/React.createElement(Inline, {
space: "space.050"
}, /*#__PURE__*/React.createElement(Text, {
size: "small",
color: "color.text.subtlest"
}, description), /*#__PURE__*/React.createElement(Text, {
size: "small",
color: "color.text.subtlest"
}, containerTypeText)),
iconBefore: /*#__PURE__*/React.createElement(ContainerIcon, {
containerType: containerType,
title: title,
containerIcon: containerIcon,
size: "small"
}),
iconAfter: /*#__PURE__*/React.createElement(Box, {
backgroundColor: 'color.background.neutral.subtle',
xcss: styles.containerTypeIconButtonStyles,
testId: "container-type-icon"
}, icon),
testId: "team-connection-item"
}, /*#__PURE__*/React.createElement(Text, {
maxLines: 1,
color: "color.text"
}, title));
};