diff --git a/packages/twenty-ui/src/display/chip/components/EntityChip.tsx b/packages/twenty-ui/src/display/chip/components/EntityChip.tsx index 740875fe5ad5..4f422f0da60b 100644 --- a/packages/twenty-ui/src/display/chip/components/EntityChip.tsx +++ b/packages/twenty-ui/src/display/chip/components/EntityChip.tsx @@ -1,5 +1,3 @@ -import * as React from 'react'; -import { useNavigate } from 'react-router-dom'; import { useTheme } from '@emotion/react'; import { isNonEmptyString } from '@sniptt/guards'; @@ -21,12 +19,14 @@ export type EntityChipProps = { maxWidth?: number; }; +type InnerEntityChipProps = EntityChipProps; + export enum EntityChipVariant { Regular = 'regular', Transparent = 'transparent', } -export const EntityChip = ({ +const InnerEntityChip = ({ linkToEntity, entityId, name, @@ -36,18 +36,9 @@ export const EntityChip = ({ LeftIcon, className, maxWidth, -}: EntityChipProps) => { - const navigate = useNavigate(); +}: InnerEntityChipProps) => { const theme = useTheme(); - const handleLinkClick = (event: React.MouseEvent) => { - if (isNonEmptyString(linkToEntity)) { - event.preventDefault(); - event.stopPropagation(); - navigate(linkToEntity); - } - }; - return ( ); }; + +export const EntityChip = ({ + linkToEntity, + entityId, + name, + avatarUrl, + avatarType = 'rounded', + variant = EntityChipVariant.Regular, + LeftIcon, + className, + maxWidth, +}: EntityChipProps) => { + if (isNonEmptyString(linkToEntity)) { + return ( + + + + ); + } else { + return ( + + ); + } +}; \ No newline at end of file