import React, { Component } from 'react' import PropTypes from 'prop-types' import { connect } from 'react-redux' import FileChooser from '../common/FileChooser' import Dropdown, {Divider} from '../common/Dropdown' import * as flowsActions from '../../ducks/flows' import * as modalActions from '../../ducks/ui/modal' import HideInStatic from "../common/HideInStatic"; FileMenu.propTypes = { clearFlows: PropTypes.func.isRequired, loadFlows: PropTypes.func.isRequired, saveFlows: PropTypes.func.isRequired, } FileMenu.onNewClick = (e, clearFlows) => { e.preventDefault(); if (confirm('Delete all flows?')) clearFlows() } export function FileMenu ({clearFlows, loadFlows, saveFlows}) { return ( FileMenu.onNewClick(e, clearFlows)}>  New loadFlows(file)} /> { e.preventDefault(); saveFlows();}}>  Save...  Install Certificates... ) } export default connect( null, { clearFlows: flowsActions.clear, loadFlows: flowsActions.upload, saveFlows: flowsActions.download, } )(FileMenu)