import { FC } from 'react'; import { Flex, Box, Avatar } from '../../../general'; export type ContactData = { patp: string; nickname?: string; color: string; avatar?: string; }; interface AvatarRowProps { direction?: 'horizontal' | 'vertical'; people: ContactData[]; size: number; borderRadiusOverride?: string; offset?: number; } export const AvatarRow: FC = ({ people, direction = 'horizontal', size, borderRadiusOverride, offset = 6, }: AvatarRowProps) => { const directionStyle: any = direction === 'horizontal' ? { flexDirection: 'row', ml: `${offset}px` } : { flexDirection: 'column', mt: `${offset}px` }; return ( {people.map((person: ContactData, index: number) => { let offsetStyle: any = { marginLeft: `-${offset}px`, clipPath: index === 0 ? 'none' : `inset(0px 0px 0px ${offset + 1.2}px round 0px)`, }; if (direction === 'vertical') { offsetStyle = { marginTop: `-${offset}px`, clipPath: index === 0 ? 'none' : `inset(${offset + 1.2}px 0px 0px 0px round 0px)`, }; } return ( ); })} ); };