import React from 'react'; import {FormattedMessage} from 'react-intl'; import {AllBadgesBadge} from '../../types/badges'; import BadgeImage from '../utils/badge_image'; import {markdown} from 'utils/markdown'; import './all_badges_row.scss'; type Props = { badge: AllBadgesBadge; onClick: (badge: AllBadgesBadge) => void; } function getGrantedText(badge: AllBadgesBadge): React.ReactNode { if (badge.granted === 0) { return ( ); } if (badge.multiple) { return ( ); } return ( ); } const AllBadgesRow: React.FC = ({badge, onClick}: Props) => { return ( onClick(badge)} > {' '} {badge.name} {' '} {badge.description ? markdown(badge.description) : '-'} {' · '} {getGrantedText(badge)} ); }; export default AllBadgesRow;