import { lazy } from '@fuselab/ui-shared/lib'; import { ActionButton, CommandButton, IButtonProps } from 'office-ui-fabric-react/lib-commonjs/Button'; import * as React from 'react'; export interface ButtonProps extends IButtonProps { item: T; itemClicked(t: T); } /** * Action button with context on click */ export class GenericButton extends ActionButton { constructor(props: ButtonProps) { super(props); } public render(): JSX.Element { return ; } @lazy() private get handleClick(): React.MouseEventHandler { return x => { const props: ButtonProps = this.props as any; props.itemClicked(props.item); }; } }