Skip to content

Commit

Permalink
feat: refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
NikitaCG committed Apr 9, 2024
1 parent 3db4a33 commit 80e153c
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions src/components/UserLabel/UserLabel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,9 @@ export const UserLabel = React.forwardRef<HTMLDivElement, UserLabelProps>(

let avatarProps;
if (typeof avatar === 'string') {
if (!avatar && typeof children === 'string') {
avatarProps = {
imgUrl: avatar,
text: children,
};
} else {
avatarProps = {
imgUrl: avatar,
};
}
avatarProps = {
imgUrl: avatar,
};
} else if (avatar && !React.isValidElement(avatar)) {
avatarProps = avatar;
} else if (!avatar && typeof children === 'string') {
Expand Down

0 comments on commit 80e153c

Please sign in to comment.