in public/components/content-list-item/word-count-helpers.ts [3:21]
const getContentLengthCategory = function (
commissionedLength: number | undefined | null,
wordCount: number | undefined | null,
): ContentLengthCategory {
if (typeof commissionedLength !== 'number' || typeof wordCount !== 'number') {
return 'none';
}
const wordsLeft = commissionedLength - wordCount;
if (wordsLeft > 50) {
return 'low';
}
if (wordsLeft <= 50 && wordsLeft >= 0) {
return 'near';
}
if (wordsLeft >= -50) {
return 'over';
}
return 'alert';
};