parent
c05932c261
commit
94db04ede7
7 changed files with 74 additions and 30 deletions
@ -0,0 +1,43 @@ |
||||
import { |
||||
ForwardRefExoticComponent, |
||||
PropsWithChildren, |
||||
RefAttributes, |
||||
forwardRef, |
||||
} from 'react'; |
||||
|
||||
import Dialog from './Dialog'; |
||||
import DialogHeader from './DialogHeader'; |
||||
|
||||
const DialogWithHeader: ForwardRefExoticComponent< |
||||
PropsWithChildren<DialogWithHeaderProps> & |
||||
RefAttributes<DialogForwardedRefContent> |
||||
> = forwardRef<DialogForwardedRefContent, DialogWithHeaderProps>( |
||||
(props, ref) => { |
||||
const { |
||||
children, |
||||
dialogProps, |
||||
header, |
||||
loading, |
||||
openInitially, |
||||
showClose, |
||||
wide, |
||||
} = props; |
||||
|
||||
return ( |
||||
<Dialog |
||||
dialogProps={dialogProps} |
||||
loading={loading} |
||||
openInitially={openInitially} |
||||
ref={ref} |
||||
wide={wide} |
||||
> |
||||
<DialogHeader showClose={showClose}>{header}</DialogHeader> |
||||
{children} |
||||
</Dialog> |
||||
); |
||||
}, |
||||
); |
||||
|
||||
DialogWithHeader.displayName = 'DialogWithHeader'; |
||||
|
||||
export default DialogWithHeader; |
Loading…
Reference in new issue