import * as React from "react" ; import { Redirect } from "react-router-dom" ; import { compose , lifecycle , pure , setDisplayName } from "recompose" ; import { LeaveRequest } from "common" ; import { WithFormSubmit , withNotification , WithNotificationDispatch } from "enhancers" ; /**
 * Sign out success properties
 */ export type LeaveSuccessProps = WithFormSubmit < LeaveRequest > ; /**
 * Lifecycle properties
 */ type LifecycleProps = LeaveSuccessProps & WithNotificationDispatch ; return export const Render = ( ) => < Redirect to = "/" / > ; return export function enhance ( ) { return compose < { } , LeaveSuccessProps > ( withNotification ( ) , lifecycle < LifecycleProps , { } > ( { componentWillMount ( ) { const { form , dismissNotification } = this . props ; if ( form . err ) dismissNotification ( ) ; } } ) , pure , setDisplayName ( "LeaveSuccess" ) ) ; } /**
 * Sign out success component
 */ export const LeaveSuccess = enhance ( ) ( Render ) ;