// @flow import * as ICONS from 'constants/icons'; import * as MODALS from 'constants/modal_types'; import React from 'react'; import classnames from 'classnames'; import { Menu, MenuButton, MenuList, MenuItem } from '@reach/menu-button'; import Icon from 'component/common/icon'; import * as PAGES from 'constants/pages'; import { useHistory } from 'react-router'; type Props = { inline?: boolean, doOpenModal: (string, {}) => void, collectionName?: string, collectionId: string, }; function CollectionMenuList(props: Props) { const { inline = false, collectionId, collectionName, doOpenModal } = props; const { push } = useHistory(); return ( { e.stopPropagation(); e.preventDefault(); }} > {collectionId && collectionName && ( <> push(`/$/${PAGES.LIST}/${collectionId}`)}> {__('View List')} push(`/$/${PAGES.LIST}/${collectionId}?view=edit`)} >
{__('Publish List')}
doOpenModal(MODALS.COLLECTION_DELETE, { collectionId })} >
{__('Delete List')}
)}
); } export default CollectionMenuList;