| 1 |
import type { JSX } from 'react'; |
| 2 |
|
| 3 |
export interface WizardDrawerWrapperProps { |
| 4 |
/** The wizard content */ |
| 5 |
children: React.ReactElement<any>; |
| 6 |
/** Flag indicating the wizard has a drawer for at least one of the wizard steps */ |
| 7 |
hasDrawer: boolean; |
| 8 |
/** The drawer component which wraps the wizard content */ |
| 9 |
wrapper: (children: React.ReactElement<any>) => JSX.Element; |
| 10 |
} |
| 11 |
|
| 12 |
export const WizardDrawerWrapper: React.FunctionComponent<WizardDrawerWrapperProps> = ({ |
| 13 |
hasDrawer, |
| 14 |
wrapper, |
| 15 |
children |
| 16 |
}) => (hasDrawer ? wrapper(children) : children); |
| 17 |
|
| 18 |
WizardDrawerWrapper.displayName = 'WizardDrawerWrapper'; |