Files
twenty/packages/twenty-front/src/modules/ui/field/display/components/ArrayDisplay.tsx
Lucas Bordeau 8333892647 Fixed context menu on index page (#9316)
Fixes https://github.com/twentyhq/twenty/issues/8970

The context menu wasn't working because of wrong architecture with the
Dropdown component, as it's a unique behavior (no clickable component
and portal) it also required refactoring a bit the Dropdown component.

- Context menu now uses a portal
- Fixed dropdown offset without clickable component (now using a
fallback anchor component)
- Fixed React array key props
2025-01-03 10:11:33 +00:00

23 lines
578 B
TypeScript

import { Chip, ChipVariant } from 'twenty-ui';
import { FieldArrayValue } from '@/object-record/record-field/types/FieldMetadata';
import { ExpandableList } from '@/ui/layout/expandable-list/components/ExpandableList';
type ArrayDisplayProps = {
value: FieldArrayValue;
};
export const ArrayDisplay = ({ value }: ArrayDisplayProps) => {
return (
<ExpandableList>
{value?.map((item, index) => (
<Chip
key={`${item}-${index}`}
variant={ChipVariant.Highlighted}
label={item}
/>
))}
</ExpandableList>
);
};