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(), }); };