4ef805282d
新增 PlatformDangerConfirmDialog 统一承接危险确认壳层 迁移平台入口删除作品确认复用共享危险确认弹窗 迁移 RPG 结果页重新生成确认复用共享危险确认弹窗 补充共享组件测试并更新 PlatformUiKit 收口文档与决策记录
79 lines
1.8 KiB
TypeScript
79 lines
1.8 KiB
TypeScript
import type { ReactNode } from 'react';
|
|
|
|
import { UnifiedConfirmDialog } from './UnifiedConfirmDialog';
|
|
|
|
type PlatformDangerConfirmDialogProps = {
|
|
open: boolean;
|
|
title: string;
|
|
onClose: () => void;
|
|
onConfirm?: () => void;
|
|
description?: ReactNode;
|
|
children?: ReactNode;
|
|
confirmLabel?: string;
|
|
busy?: boolean;
|
|
busyConfirmLabel?: string;
|
|
cancelLabel?: string;
|
|
closeOnBackdrop?: boolean;
|
|
showCloseButton?: boolean;
|
|
portal?: boolean;
|
|
size?: 'sm' | 'md';
|
|
variant?: 'platform' | 'pixel';
|
|
overlayClassName?: string;
|
|
panelClassName?: string;
|
|
footerClassName?: string;
|
|
confirmClassName?: string;
|
|
};
|
|
|
|
/**
|
|
* 平台危险确认弹窗。
|
|
* 统一承接需要“确认 / 取消 + 危险主动作”语义的标准弹窗壳层。
|
|
*/
|
|
export function PlatformDangerConfirmDialog({
|
|
open,
|
|
title,
|
|
onClose,
|
|
onConfirm,
|
|
description,
|
|
children,
|
|
confirmLabel = '确认',
|
|
busy = false,
|
|
busyConfirmLabel,
|
|
cancelLabel = '取消',
|
|
closeOnBackdrop = true,
|
|
showCloseButton = true,
|
|
portal = true,
|
|
size = 'sm',
|
|
variant = 'platform',
|
|
overlayClassName,
|
|
panelClassName,
|
|
footerClassName,
|
|
confirmClassName,
|
|
}: PlatformDangerConfirmDialogProps) {
|
|
return (
|
|
<UnifiedConfirmDialog
|
|
open={open}
|
|
title={title}
|
|
description={description}
|
|
onClose={onClose}
|
|
onConfirm={onConfirm}
|
|
confirmLabel={confirmLabel}
|
|
busy={busy}
|
|
busyConfirmLabel={busyConfirmLabel}
|
|
cancelLabel={cancelLabel}
|
|
closeOnBackdrop={closeOnBackdrop}
|
|
showCloseButton={showCloseButton}
|
|
showCancel
|
|
confirmTone="danger"
|
|
portal={portal}
|
|
size={size}
|
|
variant={variant}
|
|
overlayClassName={overlayClassName}
|
|
panelClassName={panelClassName}
|
|
footerClassName={footerClassName}
|
|
confirmClassName={confirmClassName}
|
|
>
|
|
{children}
|
|
</UnifiedConfirmDialog>
|
|
);
|
|
}
|