import React from 'react'; import classNames from 'classnames'; import { Avatar, AvatarSize, CrownIcon } from './avatar/Avatar'; import { Constants } from '../session'; import { SessionIcon } from './icon'; import { useConversationUsernameOrShorten } from '../hooks/useParamSelector'; import styled from 'styled-components'; const AvatarContainer = styled.div` position: relative; `; const AvatarItem = (props: { memberPubkey: string; isAdmin: boolean }) => { const { memberPubkey, isAdmin } = props; return ( {isAdmin && } ); }; export const MemberListItem = (props: { pubkey: string; isSelected: boolean; // this bool is used to make a zombie appear with less opacity than a normal member isZombie?: boolean; isAdmin?: boolean; // if true, we add a small crown on top of their avatar onSelect?: (pubkey: string) => void; onUnselect?: (pubkey: string) => void; }) => { const { isSelected, pubkey, isZombie, isAdmin, onSelect, onUnselect } = props; const memberName = useConversationUsernameOrShorten(pubkey); return (
{ isSelected ? onUnselect?.(pubkey) : onSelect?.(pubkey); }} role="button" >
{memberName}
); };