Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | 66x 4x 4x 2x 2x 2x 3x 2x 2x | import React, { ReactElement } from 'react';
import { TableMode } from '@props/RecordProps';
import { Popover, Tag } from 'antd';
import ObjectCell from './ObjectCell';
interface MultipleObjectsCellRenderProps {
domainName: string;
labelField?: string;
displayText?: string;
tableMode?: TableMode;
ids?: Array<number>;
zIndex: number;
}
const MultipleObjectsCell = (props: MultipleObjectsCellRenderProps): ReactElement => {
const {
domainName, labelField, tableMode, zIndex, ids,
} = props;
if (ids == null || ids.length === 0) {
return (<></>);
} else if (Array.isArray(ids)) {
const elems = ids?.map((id, idx) => {
return (<ObjectCell
domainName={domainName}
id={id}
zIndex={zIndex}
key={`${id}_${idx}`}
labelField={labelField}
tableMode={tableMode}
/>);
});
const result = (
<Popover
trigger="click"
placement="right"
overlayClassName="tag-popover"
content={
<div className="objects"> {elems} </div>
}
overlayStyle={{ zIndex: zIndex + 1 }}
>
<Tag className="object-id-tag">
» » »
</Tag>
</Popover>
);
return result;
} else E{
return (<></>);
}
};
export default MultipleObjectsCell;
|