You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

16 lines
444 B

import { ModalProps } from 'antd'
import { ReactElement, cloneElement } from 'react'
import './style.scss'
type Props = ModalProps & { children: ReactElement }
export type DankFormProps = {
onSave?: () => void
onCancel?: () => void
}
export const Modal = ({ children, visible }: Props) => {
const el = cloneElement(children, (props: DankFormProps) => ({ ...props }))
return visible ? <div className="dank-modal">{el}</div> : null
}