Skip to content

The open alternative to Salesforce, designed for AI.

fix: 802 if no text dont show avatar (#831)

310387c4468d60f6d5
diff --git a/front/src/modules/ui/chip/components/EntityChip.tsx b/front/src/modules/ui/chip/components/EntityChip.tsx
index f18f7bc0fc3..c2865c4f4af 100644
--- a/front/src/modules/ui/chip/components/EntityChip.tsx
+++ b/front/src/modules/ui/chip/components/EntityChip.tsx
@@ -4,6 +4,7 @@ import { Theme } from '@emotion/react';
import styled from '@emotion/styled';
import { Avatar, AvatarType } from '@/users/components/Avatar';
+import { isNonEmptyString } from '~/utils/isNonEmptyString';
import { OverflowingTextWithTooltip } from '../../tooltip/OverflowingTextWithTooltip';
@@ -89,26 +90,30 @@ export function EntityChip({
onClick={handleLinkClick}
variant={variant}
>
- <Avatar
- avatarUrl={picture}
- colorId={entityId}
- placeholder={name}
- size={14}
- type={avatarType}
- />
+ {isNonEmptyString(name) && (
+ <Avatar
+ avatarUrl={picture}
+ colorId={entityId}
+ placeholder={name}
+ size={14}
+ type={avatarType}
+ />
+ )}
<StyledName>
<OverflowingTextWithTooltip text={name} />
</StyledName>
</StyledContainerLink>
) : (
<StyledContainerReadOnly data-testid="entity-chip">
- <Avatar
- avatarUrl={picture}
- colorId={entityId}
- placeholder={name}
- size={14}
- type={avatarType}
- />
+ {isNonEmptyString(name) && (
+ <Avatar
+ avatarUrl={picture}
+ colorId={entityId}
+ placeholder={name}
+ size={14}
+ type={avatarType}
+ />
+ )}
<StyledName>
<OverflowingTextWithTooltip text={name} />
</StyledName>