mirror of
https://github.com/SigNoz/signoz.git
synced 2025-12-25 11:30:08 +00:00
* feat: added download as csv support for table panel type * feat: update the position of download * fix: build issues * fix: address review comments
24 lines
679 B
TypeScript
24 lines
679 B
TypeScript
import { MenuItemType } from 'antd/es/menu/hooks/useItems';
|
|
|
|
import { MenuItemKeys } from './contants';
|
|
import { MenuItem } from './types';
|
|
|
|
export const generateMenuList = (actions: MenuItem[]): MenuItemType[] =>
|
|
actions
|
|
.filter((action: MenuItem) => action.isVisible)
|
|
.map(({ key, icon: Icon, label, disabled, ...rest }) => ({
|
|
key,
|
|
icon: Icon,
|
|
label,
|
|
disabled,
|
|
...rest,
|
|
}));
|
|
|
|
export const isTWidgetOptions = (value: string): value is MenuItemKeys =>
|
|
value === MenuItemKeys.View ||
|
|
value === MenuItemKeys.Edit ||
|
|
value === MenuItemKeys.Delete ||
|
|
value === MenuItemKeys.Clone ||
|
|
value === MenuItemKeys.CreateAlerts ||
|
|
value === MenuItemKeys.Download;
|