import { PlatformAcknowledgeStatusDialog } from '../common/PlatformAcknowledgeStatusDialog'; export type DraftGenerationPointNotice = | { kind: 'insufficient-points'; requiredPoints: number; currentPoints: number; } | { kind: 'balance-load-failed'; }; type PlatformDraftGenerationPointNoticeDialogProps = { notice: DraftGenerationPointNotice | null; onClose: () => void; overlayClassName?: string; panelClassName?: string; zIndexClassName?: string; }; function resolveDraftGenerationPointNoticeTitle( notice: DraftGenerationPointNotice, ) { return notice.kind === 'balance-load-failed' ? '读取泥点余额失败' : '泥点不足'; } function resolveDraftGenerationPointNoticeDescription( notice: DraftGenerationPointNotice, ) { return notice.kind === 'balance-load-failed' ? '当前表单不会丢失,关闭后可继续编辑,稍后再试。' : '当前表单不会丢失,关闭后可继续编辑或补足泥点再继续。'; } function resolveDraftGenerationPointNoticeMessage( notice: DraftGenerationPointNotice, ) { return notice.kind === 'balance-load-failed' ? '请稍后重试。' : `本次需要 ${notice.requiredPoints} 泥点,当前 ${notice.currentPoints} 泥点。`; } /** * 创作前置泥点提示弹层。 * 只承接平台入口里“泥点不足 / 读取余额失败”这类阻断提示,避免 FlowShell 直接拼底层状态弹窗。 */ export function PlatformDraftGenerationPointNoticeDialog({ notice, onClose, overlayClassName, panelClassName, zIndexClassName, }: PlatformDraftGenerationPointNoticeDialogProps) { if (!notice) { return null; } return ( {resolveDraftGenerationPointNoticeMessage(notice)} ); }