import * as React from 'react'; import classNames from 'classnames'; import { Panel } from 'rc-dialog'; import type { PanelProps } from 'rc-dialog/lib/Dialog/Content/Panel'; import { withPureRenderTheme } from '../_util/PurePanel'; import { ConfigContext } from '../config-provider'; import useCSSVarCls from '../config-provider/hooks/useCSSVarCls'; import { ConfirmContent } from './ConfirmDialog'; import type { ModalFuncProps } from './interface'; import { Footer, renderCloseIcon } from './shared'; import useStyle from './style'; export interface PurePanelProps extends Omit, Pick { prefixCls?: string; style?: React.CSSProperties; } const PurePanel: React.FC = (props) => { const { prefixCls: customizePrefixCls, className, closeIcon, closable, type, title, children, footer, ...restProps } = props; const { getPrefixCls } = React.useContext(ConfigContext); const rootPrefixCls = getPrefixCls(); const prefixCls = customizePrefixCls || getPrefixCls('modal'); const rootCls = useCSSVarCls(rootPrefixCls); const [wrapCSSVar, hashId, cssVarCls] = useStyle(prefixCls, rootCls); const confirmPrefixCls = `${prefixCls}-confirm`; // Choose target props by confirm mark let additionalProps: Partial = {}; if (type) { additionalProps = { closable: closable ?? false, title: '', footer: '', children: ( ), }; } else { additionalProps = { closable: closable ?? true, title, footer: footer !== null &&