diff --git a/frontend/src/container/ExportPanel/config.ts b/frontend/src/container/ExportPanel/config.ts deleted file mode 100644 index a70d996b79e0..000000000000 --- a/frontend/src/container/ExportPanel/config.ts +++ /dev/null @@ -1,9 +0,0 @@ -export const MENU_KEY = { - EXPORT: 'export', - CREATE_ALERTS: 'create-alerts', -}; - -export const MENU_LABEL = { - EXPORT: 'Export Panel', - CREATE_ALERTS: 'Create Alerts', -}; diff --git a/frontend/src/container/ExportPanel/index.tsx b/frontend/src/container/ExportPanel/index.tsx index 467051cb3fc0..8447814fa788 100644 --- a/frontend/src/container/ExportPanel/index.tsx +++ b/frontend/src/container/ExportPanel/index.tsx @@ -1,12 +1,12 @@ -import { Button, Dropdown, MenuProps, Modal } from 'antd'; +import { AlertOutlined, AreaChartOutlined } from '@ant-design/icons'; +import { Button, Modal, Space } from 'antd'; import { queryParamNamesMap } from 'constants/queryBuilderQueryNames'; import ROUTES from 'constants/routes'; import history from 'lib/history'; -import { useCallback, useMemo, useState } from 'react'; +import { useCallback, useState } from 'react'; import { Dashboard } from 'types/api/dashboard/getAll'; import { Query } from 'types/api/queryBuilder/queryBuilderData'; -import { MENU_KEY, MENU_LABEL } from './config'; import ExportPanelContainer from './ExportPanel'; function ExportPanel({ @@ -28,45 +28,30 @@ function ExportPanel({ ); }, [query]); - const onMenuClickHandler: MenuProps['onClick'] = useCallback( - (e: OnClickProps) => { - if (e.key === MENU_KEY.EXPORT) { - onModalToggle(true); - } - - if (e.key === MENU_KEY.CREATE_ALERTS) { - onCreateAlertsHandler(); - } - }, - [onModalToggle, onCreateAlertsHandler], - ); - - const menu: MenuProps = useMemo( - () => ({ - items: [ - { - key: MENU_KEY.EXPORT, - label: MENU_LABEL.EXPORT, - }, - { - key: MENU_KEY.CREATE_ALERTS, - label: MENU_LABEL.CREATE_ALERTS, - }, - ], - onClick: onMenuClickHandler, - }), - [onMenuClickHandler], - ); - const onCancel = (value: boolean) => (): void => { onModalToggle(value); }; + const onAddToDashboard = (): void => { + setIsExport(true); + }; + return ( <> - - - + + + + + + void;