cb9d836227
集中保留原版权声明,移除文件头检查和全局测试忽略规则。验证:全量单测、受影响用例复测及静态检查通过。
21 lines
865 B
JavaScript
21 lines
865 B
JavaScript
import { Modal } from '@/components/ui';
|
|
import { formatQuoteAmount } from '../../hooks/creation/useCreationQuote';
|
|
|
|
/**
|
|
* 多张生成合计超过系统阈值时的二次确认弹窗(方案 §4.4 / 决策 3)。
|
|
* 手动提交(CreationDock)与自动提交(再生成 / 换种子再来,useCreationForm)共用。
|
|
*/
|
|
export const openBatchConfirm = ({ t, n, quote, onOk, onCancel }) => {
|
|
const amount = formatQuoteAmount(quote?.display_amount, quote?.currency);
|
|
Modal.confirm({
|
|
title: t('确认生成 {{n}} 张图片?', { n }),
|
|
content: amount
|
|
? t('本次预计消耗 {{amount}},金额较高,请确认后再生成', { amount })
|
|
: t('本次合计金额较高,请确认后再生成'),
|
|
okText: t('确认生成'),
|
|
cancelText: t('取消'),
|
|
onOk: () => onOk(),
|
|
onCancel: () => onCancel && onCancel(),
|
|
});
|
|
};
|