import { FC, MouseEvent } from 'react' import { CSSTransition, SwitchTransition } from 'react-transition-group' import { absoluteRoutes } from '@/config/routes' import { useMediaMatch } from '@/hooks/useMediaMatch' import { cVar, transitions } from '@/styles' import { MembershipDetails, MembershipHeader, MembershipInfoContainer, StyledHandle } from './MembershipInfo.style' import { SvgActionEdit } from '../../assets/icons' import { Avatar } from '../Avatar' import { Button } from '../_buttons/Button' import { CopyAddressButton } from '../_buttons/CopyAddressButton/CopyAddressButton' import { SkeletonLoader } from '../_loaders/SkeletonLoader' export type MembershipInfoProps = { avatarUrl?: string | null avatarLoading?: boolean hasAvatarUploadFailed?: boolean onAvatarEditClick?: (event: MouseEvent) => void onImageValidation?: (validImage: boolean) => void handle?: string | null address?: string | null loading?: boolean isOwner?: boolean editable?: boolean className?: string } export const MembershipInfo: FC = ({ address, avatarUrl, avatarLoading, hasAvatarUploadFailed, onAvatarEditClick, onImageValidation, handle, loading, isOwner, editable, className, }) => { const smMatch = useMediaMatch('sm') return ( {loading ? ( ) : ( {handle || '\xa0'} )} {loading || !address ? ( ) : ( )} {isOwner && (loading ? ( ) : ( ))} ) }