import React from 'react' ; import { Button } from '@bug-ui' ; const CloseReopenButton = ( { onRequestToggle , isOpen , isLoading } ) => ( < Button isLoading = { isLoading } variant = { isOpen ? 'danger' : 'success' } icon = { isOpen ? 'times' : 'history' } onClick = { ( e ) => { e . preventDefault ( ) ; onRequestToggle ( isOpen ? 'close' : 'open' ) ; } } > { isOpen ? 'Close' : 'Reopen' } < /Button>); export default CloseReopenButton ;