import { withStyles , WithStyles } from "@material-ui/core" ; import { omit } from "ramda" ; import * as React from "react" ; import { Link , LinkProps } from "react-router-dom" ; import { compose , mapProps , pure , setDisplayName , withHandlers } from "recompose" ; import { withNotification , WithNotificationDispatch } from "enhancers" ; import { styles , Styles } from "./TextLink.styles" ; /**
 * Text link properties
 */ export type TextLinkProps = LinkProps ; /**
 * Handler properties
 */ interface HandlerProps { handleClickCapture ( ) : void ; } /**
 * Handler callback properties
 */ type HandlerCallbackProps = WithNotificationDispatch ; /**
 * Render properties
 */ export type RenderProps = TextLinkProps & WithStyles < Styles > & HandlerProps ; param props return export const Render = ( { classes , children , handleClickCapture , ... props } ) => < Link className = { classes . root } onClickCapture = { handleClickCapture } { ... props } > { children } < /Link>; return export function enhance ( ) { return compose < RenderProps , TextLinkProps > ( withStyles ( styles ) , withNotification ( ) , withHandlers < HandlerCallbackProps , HandlerProps > ( { handleClickCapture : ( { dismissNotification } ) => dismissNotification } ) , mapProps ( omit ( [ "notification" , "displayNotification" , "dismissNotification" ] ) ) , pure , setDisplayName ( "TextLink" ) ) ; } /**
 * Text link component
 */ export const TextLink = enhance ( ) ( Render ) ;