mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-10-19 23:41:08 +08:00

* fix: fix initial columns for the list view * fix: replace columns * fix: update attribute api call for the options menu * fix: update call attributes API call * fix: add error msg for the options list
17 lines
435 B
TypeScript
17 lines
435 B
TypeScript
import { SelectProps } from 'antd';
|
|
import { BaseAutocompleteData } from 'types/api/queryBuilder/queryAutocompleteResponse';
|
|
|
|
export const getOptionsFromKeys = (
|
|
keys: BaseAutocompleteData[],
|
|
selectedKeys: (string | undefined)[],
|
|
): SelectProps['options'] => {
|
|
const options = keys.map(({ id, key }) => ({
|
|
label: key,
|
|
value: id,
|
|
}));
|
|
|
|
return options.filter(
|
|
({ value }) => !selectedKeys.find((key) => key === value),
|
|
);
|
|
};
|