@atlaskit/profilecard
Version:
A React component to display a card with user information.
32 lines • 2.07 kB
JavaScript
import _defineProperty from "@babel/runtime/helpers/defineProperty";
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
import React, { useEffect } from 'react';
import { useIntl } from 'react-intl-next';
import EmptyState from '@atlaskit/empty-state';
import messages from '../../messages';
import { AccessLockSVGWrapper, TeamForbiddenErrorStateWrapper } from '../../styled/TeamCard';
import { PACKAGE_META_DATA } from '../../util/analytics';
import { getPageTime } from '../../util/performance';
import AccessLockSVG from '../Error/AccessLockSVG';
export default (function (props) {
var analytics = props.analytics;
var intl = useIntl();
useEffect(function () {
analytics('ui.teamProfileCard.rendered.error', function (duration) {
return _objectSpread({
duration: duration,
firedAt: Math.round(getPageTime())
}, PACKAGE_META_DATA);
});
}, [analytics]);
return /*#__PURE__*/React.createElement(TeamForbiddenErrorStateWrapper, {
testId: "team-profilecard-forbidden-error-state"
}, /*#__PURE__*/React.createElement(EmptyState, {
header: intl.formatMessage(messages.teamForbiddenErrorStateTitle),
description: intl.formatMessage(messages.teamForbiddenErrorStateDescription),
renderImage: function renderImage() {
return /*#__PURE__*/React.createElement(AccessLockSVGWrapper, null, /*#__PURE__*/React.createElement(AccessLockSVG, null));
}
}));
});