2023-08-02 11:24:32 -04:00
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
|
|
|
|
import { FormattedMessage } from 'react-intl';
|
|
|
|
|
2024-01-12 05:31:24 -05:00
|
|
|
import GroupsIcon from '@material-symbols/svg-600/outlined/group.svg?react';
|
|
|
|
import PersonIcon from '@material-symbols/svg-600/outlined/person.svg?react';
|
|
|
|
import SmartToyIcon from '@material-symbols/svg-600/outlined/smart_toy.svg?react';
|
2023-08-02 11:24:32 -04:00
|
|
|
|
|
|
|
|
|
|
|
export const Badge = ({ icon, label, domain }) => (
|
|
|
|
<div className='account-role'>
|
|
|
|
{icon}
|
|
|
|
{label}
|
|
|
|
{domain && <span className='account-role__domain'>{domain}</span>}
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
|
|
|
|
Badge.propTypes = {
|
|
|
|
icon: PropTypes.node,
|
|
|
|
label: PropTypes.node,
|
|
|
|
domain: PropTypes.node,
|
|
|
|
};
|
|
|
|
|
|
|
|
Badge.defaultProps = {
|
|
|
|
icon: <PersonIcon />,
|
|
|
|
};
|
|
|
|
|
|
|
|
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 05:31:24 -05:00
|
|
|
);
|