blessing-skin-server/resources/assets/src/components/ModalBody.tsx
2020-03-28 16:09:12 +08:00

30 lines
712 B
TypeScript

import React from 'react'
import ModalContent from './ModalContent'
import ModalInput from './ModalInput'
import type { Props as ContentProps } from './ModalContent'
import type {
Props as InputProps,
InternalProps as InputInteralProps,
} from './ModalInput'
interface InternalProps {
showInput: boolean
}
export type Props = ContentProps & InputProps
const ModalBody: React.FC<InternalProps & InputInteralProps & Props> = (
props,
) => {
return (
<div className="modal-body">
<ModalContent text={props.text} dangerousHTML={props.dangerousHTML}>
{props.children}
</ModalContent>
{props.showInput && <ModalInput {...props} />}
</div>
)
}
export default ModalBody