mirror of
https://github.com/glitch-soc/mastodon.git
synced 2024-11-26 18:14:15 -05:00
134de736dc
Co-authored-by: Renaud Chaput <renchap@gmail.com>
34 lines
1021 B
JavaScript
34 lines
1021 B
JavaScript
import PropTypes from 'prop-types';
|
|
|
|
import { FormattedMessage } from 'react-intl';
|
|
|
|
import { ReactComponent as GroupsIcon } from '@material-symbols/svg-600/outlined/group.svg';
|
|
import { ReactComponent as PersonIcon } from '@material-symbols/svg-600/outlined/person.svg';
|
|
import { ReactComponent as SmartToyIcon } from '@material-symbols/svg-600/outlined/smart_toy.svg';
|
|
|
|
|
|
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' />} />
|
|
); |