dbfdb9b99b
新增 PlatformMudPointConfirmDialog 统一承接标准泥点消耗确认壳层 迁移拼图与抓大鹅创作工作台复用共享泥点确认弹窗 迁移拼图与抓大鹅结果页素材生成流程复用共享泥点确认弹窗 补充共享组件测试并更新 PlatformUiKit 收口文档与决策记录
65 lines
1.5 KiB
TypeScript
65 lines
1.5 KiB
TypeScript
import type { ReactNode } from 'react';
|
|
|
|
import { UnifiedConfirmDialog } from './UnifiedConfirmDialog';
|
|
|
|
type PlatformMudPointConfirmDialogProps = {
|
|
open: boolean;
|
|
points: number;
|
|
onClose: () => void;
|
|
onConfirm: () => void;
|
|
confirmDisabled?: boolean;
|
|
confirmLabel?: string;
|
|
title?: string;
|
|
description?: ReactNode;
|
|
children?: ReactNode;
|
|
showCloseButton?: boolean;
|
|
portal?: boolean;
|
|
size?: 'sm' | 'md';
|
|
overlayClassName?: string;
|
|
panelClassName?: string;
|
|
};
|
|
|
|
/**
|
|
* 平台泥点消耗确认弹窗。
|
|
* 统一承接“确认消耗泥点 + 消耗 N 泥点”的标准确认壳层,业务侧只保留点数与确认动作。
|
|
*/
|
|
export function PlatformMudPointConfirmDialog({
|
|
open,
|
|
points,
|
|
onClose,
|
|
onConfirm,
|
|
confirmDisabled = false,
|
|
confirmLabel = '确定',
|
|
title = '确认消耗泥点',
|
|
description,
|
|
children,
|
|
showCloseButton = true,
|
|
portal = true,
|
|
size = 'sm',
|
|
overlayClassName,
|
|
panelClassName,
|
|
}: PlatformMudPointConfirmDialogProps) {
|
|
return (
|
|
<UnifiedConfirmDialog
|
|
open={open}
|
|
title={title}
|
|
description={description}
|
|
onClose={onClose}
|
|
onConfirm={onConfirm}
|
|
confirmLabel={confirmLabel}
|
|
confirmDisabled={confirmDisabled}
|
|
showCancel
|
|
showCloseButton={showCloseButton}
|
|
portal={portal}
|
|
size={size}
|
|
overlayClassName={overlayClassName}
|
|
panelClassName={panelClassName}
|
|
>
|
|
<div className="space-y-2">
|
|
<div className="font-semibold">消耗 {points} 泥点</div>
|
|
{children}
|
|
</div>
|
|
</UnifiedConfirmDialog>
|
|
);
|
|
}
|