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
23 lines
578 B
TypeScript
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>
|
|
);
|
|
};
|