function normalizeReleaseProgress(progress: number): number {
  if (!Number.isFinite(progress)) return 0;
  return Math.min(100, Math.max(0, Math.round(progress)));
}

export function getReleaseProgressWarning(progress: number): string {
  const normalizedProgress = normalizeReleaseProgress(progress);
  if (normalizedProgress >= 100) return '';
  return `当前版本进度 ${normalizedProgress}%，仍有未完成事项。确认发版会将版本标记为已发布。`;
}

export function canSubmitReleaseForm(releaseDate: string): boolean {
  return releaseDate.trim().length > 0;
}
