import * as React from 'react'; import Component from 'react-component-component'; import Button from 'mineral-ui/Button'; import Text from 'mineral-ui/Text'; import Card, { CardActions, CardBlock, CardDivider } from 'mineral-ui/Card'; import ButtonGroup from 'mineral-ui/ButtonGroup'; import { Link as RouterLink } from 'react-router-dom'; import { ModalOverlay } from 'src/components/Modal'; import ProjectSaveModal from './SaveProjectModal'; export default () => { interface ILocalState { isCanceling: boolean; isSaving: boolean; } interface IStateContainer { state: ILocalState; setState: (s: ILocalState) => void; } const intialState: ILocalState = { isCanceling: false, isSaving: false, }; const onCancelButtonClick = (s: IStateContainer) => (e) => s.setState({ ...s.state, isCanceling: true, isSaving: false, }); const onSaveButtonClick = (s: IStateContainer) => (e) => s.setState({ ...s.state, isCanceling: false, isSaving: true, }); const closeModals = (s: IStateContainer) => () => { s.setState({ ...s.state, isCanceling: false, isSaving: false }); }; return ( {(s: IStateContainer) => ( <> {s.state.isSaving && ( )} {s.state.isCanceling && ( All unsaved configuration will be lost. Are you sure you want to exit without saving? )} )} ); };