@atlaskit/rovo-agent-components
Version:
This package host public components related to rovo agents, the components here are needed for other public atlaskit packages
36 lines • 1.31 kB
JavaScript
/* index.tsx generated by @compiled/babel-plugin v0.39.1 */
import "./index.compiled.css";
import * as React from 'react';
import { ax, ix } from "@compiled/react/runtime";
import { useIntl } from 'react-intl';
import StarIcon from '@atlaskit/icon/core/star-unstarred';
import { Box } from '@atlaskit/primitives/compiled';
import Skeleton from '@atlaskit/skeleton';
import { messages } from './messages';
import { formatNumber } from './utils';
var styles = {
count: "_11c8wadc _zulp1b66 _1e0c1txw _4cvr1h6o _bozgv77o"
};
export var AgentStarCount = function AgentStarCount(_ref) {
var starCount = _ref.starCount,
isLoading = _ref.isLoading;
var _useIntl = useIntl(),
formatMessage = _useIntl.formatMessage;
if ((starCount === null || starCount === undefined) && !isLoading) {
return null;
}
return /*#__PURE__*/React.createElement(Box, {
xcss: styles.count
}, /*#__PURE__*/React.createElement(StarIcon, {
color: "currentColor",
label: "",
size: "small"
}), isLoading ? /*#__PURE__*/React.createElement(Skeleton, {
testId: "agent-profile-info-star-count-skeleton",
isShimmering: true,
height: 16,
width: 75
}) : formatMessage(messages.starredCount, {
starCount: formatNumber(starCount !== null && starCount !== void 0 ? starCount : 0)
}));
};