import * as React from 'react'; import { Component, ComponentClass, MouseEvent, ReactNode } from 'react'; import getPassThrough, { PassTroughFunction } from '../../utils/getPassThrough'; import { OverlayProps } from '../Overlay'; export interface DialogFactoryArgs { Overlay: ComponentClass; WrapperNode: ComponentClass; passthrough: PassTroughFunction; } export interface DialogProps { active: boolean; children: ReactNode; onOverlayClick(event: MouseEvent): void; } export interface WrapperNodeProps { active: boolean; } export default function dialogFactory({ Overlay, WrapperNode, passthrough, }: DialogFactoryArgs): ComponentClass { const passProps = getPassThrough(passthrough); return class Dialog extends Component { render() { const { active, children, onOverlayClick } = this.props; return ( {children} ); } }; }