type EightAnchorProgressBarProps = { currentTurn: number; progressPercent: number; disabled: boolean; onSummaryClick: () => void; onQuickFill: () => void; onGenerateDraft: () => void; }; function clampProgress(progressPercent: number) { if (!Number.isFinite(progressPercent)) { return 0; } return Math.max(0, Math.min(100, Math.round(progressPercent))); } function resolveProgressHint(progressPercent: number) { if (progressPercent >= 100) { return '当前设定已经收束完成,可以进入草稿生成'; } if (progressPercent >= 75) { return '正在收束成一版可进入草稿的世界底子'; } if (progressPercent >= 45) { return '世界方向已经成形,继续补关键骨架'; } if (progressPercent >= 15) { return '先把玩家视角、开局和冲突线钉稳'; } return '先抓住这个世界最关键的方向'; } export function EightAnchorProgressBar({ currentTurn, progressPercent, disabled, onSummaryClick, onQuickFill, onGenerateDraft, }: EightAnchorProgressBarProps) { const normalizedProgress = clampProgress(progressPercent); const isCompleted = normalizedProgress >= 100; const canQuickFill = currentTurn >= 2; const progressFillStyle = isCompleted ? { background: 'linear-gradient(90deg, #86efac 0%, #34d399 100%)' } : { background: 'var(--platform-button-primary-fill)' }; return (
创作进度
{resolveProgressHint(normalizedProgress)}
{normalizedProgress}%
{isCompleted ? ( ) : canQuickFill ? ( ) : null}
); }