Update label associated with grade

This commit is contained in:
nemunaire 2025-10-24 16:06:14 +07:00
commit b2dc479a79

View file

@ -11,12 +11,25 @@
let { grade, score, reanalyzing, summary }: Props = $props(); let { grade, score, reanalyzing, summary }: Props = $props();
function getScoreLabel(score: number): string { function getScoreLabel(grade: string): string {
if (score >= 90) return "Excellent"; switch (grade) {
if (score >= 70) return "Good"; case "A+":
if (score >= 50) return "Fair"; return "Excellent Deliverability";
if (score >= 30) return "Poor"; case "A":
return "Critical"; return "Good Deliverability";
case "B":
return "Fair Deliverability";
case "C":
return "Moderate Issues";
case "D":
return "Poor Deliverability";
case "E":
return "Critical Issues";
case "F":
return "Severe Problems";
default:
return "Unknown Status";
}
} }
</script> </script>
@ -33,7 +46,7 @@
{#if reanalyzing} {#if reanalyzing}
Analyzing in progress&hellip; Analyzing in progress&hellip;
{:else} {:else}
{getScoreLabel(score)} {getScoreLabel(grade)}
{/if} {/if}
</h3> </h3>
<p class="text-muted mb-4">Overall Deliverability Score</p> <p class="text-muted mb-4">Overall Deliverability Score</p>