2023-08-03 01:24:32 +10:00
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
|
|
|
|
import { FormattedMessage } from 'react-intl';
|
|
|
|
|
2024-01-16 21:27:26 +11:00
|
|
|
import GroupsIcon from '@/material-icons/400-24px/group.svg?react';
|
|
|
|
import PersonIcon from '@/material-icons/400-24px/person.svg?react';
|
|
|
|
import SmartToyIcon from '@/material-icons/400-24px/smart_toy.svg?react';
|
2023-08-03 01:24:32 +10:00
|
|
|
|
|
|
|
|
2024-04-29 19:29:59 +10:00
|
|
|
export const Badge = ({ icon = <PersonIcon />, label, domain, roleId }) => (
|
2024-03-22 22:59:35 +11:00
|
|
|
<div className='account-role' data-account-role-id={roleId}>
|
2023-08-03 01:24:32 +10:00
|
|
|
{icon}
|
|
|
|
{label}
|
|
|
|
{domain && <span className='account-role__domain'>{domain}</span>}
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
|
|
|
|
Badge.propTypes = {
|
|
|
|
icon: PropTypes.node,
|
|
|
|
label: PropTypes.node,
|
|
|
|
domain: PropTypes.node,
|
2024-03-22 22:59:35 +11:00
|
|
|
roleId: PropTypes.string
|
2023-08-03 01:24:32 +10:00
|
|
|
};
|
|
|
|
|
|
|
|
export const GroupBadge = () => (
|
|
|
|
<Badge icon={<GroupsIcon />} label={<FormattedMessage id='account.badges.group' defaultMessage='Group' />} />
|
|
|
|
);
|
|
|
|
|
|
|
|
export const AutomatedBadge = () => (
|
|
|
|
<Badge icon={<SmartToyIcon />} label={<FormattedMessage id='account.badges.bot' defaultMessage='Automated' />} />
|
2024-01-12 21:31:24 +11:00
|
|
|
);
|