@atlaskit/profilecard
Version:
A React component to display a card with user information.
22 lines • 741 B
JavaScript
import { defineMessages } from 'react-intl-next';
const getLabelMessage = (ariaLabelProp, fullName, formatMessage) => {
if (ariaLabelProp) {
return ariaLabelProp;
}
return fullName ? formatMessage(messages.label, {
fullName
}) : formatMessage(messages.fallbackLabel);
};
const messages = defineMessages({
fallbackLabel: {
id: 'profilecard.user.trigger.fallback-aria-label',
defaultMessage: 'More information about this user',
description: 'Label for profile card trigger when we do not have user name'
},
label: {
id: 'profilecard.user.trigger.aria-label',
defaultMessage: 'More information about {fullName}',
description: 'Label for profile card trigger'
}
});
export default getLabelMessage;