export const COMMENT_MAX_LENGTH = 2000;

export function normalizeCommentContent(content: string): string {
  const normalized = content.trim();
  if (!normalized) {
    throw new Error("Le commentaire ne peut pas être vide.");
  }
  if (normalized.length > COMMENT_MAX_LENGTH) {
    throw new Error(`Le commentaire ne peut pas dépasser ${COMMENT_MAX_LENGTH} caractères.`);
  }
  return normalized;
}
