import Badge from 'react-bootstrap/Badge' import OverlayTrigger from 'react-bootstrap/OverlayTrigger' import Tooltip from 'react-bootstrap/Tooltip' import CowboyHatIcon from '../svgs/cowboy.svg' import AnonIcon from '../svgs/spy-fill.svg' import { numWithUnits } from '../lib/format' import { ANON_USER_ID } from '../lib/constants' export default function Hat ({ user, badge, className = 'ms-1', height = 16, width = 16 }) { if (!user) return null if (Number(user.id) === ANON_USER_ID) { return ( {badge ? ( ) : } ) } if (user.streak === null || user.hideCowboyHat) { return null } const streak = user.streak return ( {badge ? ( {streak || 'new'} ) : } ) } export function HatTooltip ({ children, overlayText, placement }) { return ( {overlayText} } trigger={['hover', 'focus']} > {children} ) }