import { branch , compose , pure , renderComponent , setDisplayName } from "recompose" ; import { withRememberMe , WithRememberMe } from "enhancers" ; import { AuthenticateWithCredentials } from "./AuthenticateWithCredentials" ; import { AuthenticateWithToken } from "./AuthenticateWithToken" ; /**
 * Branch properties
 */ type BranchProps = WithRememberMe ; /**
 * Render properties
 */ export type RenderProps = WithRememberMe ; param props return export const Render = AuthenticateWithCredentials ; return export function enhance ( ) { return compose < RenderProps , { } > ( withRememberMe ( ) , branch < BranchProps > ( ( { remember : { active , failed } } ) => active && ! failed , renderComponent ( AuthenticateWithToken ) ) , pure , setDisplayName ( "Authenticate" ) ) ; } /**
 * Authentication component
 */ export const Authenticate = enhance ( ) ( Render ) ;