mirror of
https://github.com/glitch-soc/mastodon.git
synced 2024-11-29 19:40:23 -05:00
5b67389bba
Port 01b6c83c36
to glitch-soc
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
35 lines
947 B
JavaScript
35 lines
947 B
JavaScript
import PropTypes from 'prop-types';
|
|
|
|
import { FormattedMessage } from 'react-intl';
|
|
|
|
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';
|
|
|
|
|
|
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' />} />
|
|
);
|