import { forwardRef } from 'react'; import { Link } from 'react-router-dom'; import PropTypes from 'prop-types'; import { clsm } from '../../utils'; import { FIRST_ITEM_IN_FRAME, LAST_ITEM_IN_FRAME } from './FollowingSection'; import { PROFILE_COLORS } from '../../constants'; import { useResponsiveDevice } from '../../contexts/ResponsiveDevice'; import LivePill from '../../components/LivePill'; import UserAvatar from '../../components/UserAvatar'; const FollowedUserButton = forwardRef( ( { avatarSrc, color, isLive, username, isLastItemInFrame, isFirstItemInFrame, avatarsPerFrame }, firstAndLastItemInFrameRef ) => { const { isTouchscreenDevice } = useResponsiveDevice(); return ( { if (el?.href) { if (!firstAndLastItemInFrameRef.current[avatarsPerFrame]) { firstAndLastItemInFrameRef.current[avatarsPerFrame] = { [FIRST_ITEM_IN_FRAME]: new Set(), [LAST_ITEM_IN_FRAME]: new Set() }; } if (isFirstItemInFrame) { firstAndLastItemInFrameRef.current[avatarsPerFrame][ FIRST_ITEM_IN_FRAME ].add(el.href); } if (isLastItemInFrame) { firstAndLastItemInFrameRef.current[avatarsPerFrame][ LAST_ITEM_IN_FRAME ].add(el.href); } } }} className={clsm([ 'button', 'flex-col', 'flex', 'group', 'w-auto', 'focus:outline-none' ])} to={`/${username}`} >