Skip to content

Commit 7ccf5c7

Browse files
committed
feat: easier to follow scoring for spam checker
1 parent 451f14d commit 7ccf5c7

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

packages/react-email/src/components/toolbar/spam-assassin.tsx

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -100,20 +100,25 @@ export const SpamAssassin = ({ result }: SpamAssassinProps) => {
100100
</Results.Column>
101101
<Results.Column>
102102
{result.points === 0
103-
? 'Congratulations! Your email is clean of abuse indicators.'
104-
: 'Lower scores are better'}
103+
? 'Congratulations! Younr email is clean of abuse indicators.'
104+
: 'Higher scores are better'}
105105
</Results.Column>
106106
<Results.Column
107-
className={cn(
108-
'text-right text-3xl tracking-tighter font-bold',
109-
result.points === 0 ? 'text-green-400' : null,
110-
result.points > 0 && result.points <= 1.5 ? null : null,
111-
result.points > 1.5 ? 'text-yellow-200' : null,
112-
result.points > 3 ? 'text-orange-400' : null,
113-
result.points >= 5 ? 'text-red-400' : null,
114-
)}
107+
className="text-right tracking-tighter font-bold"
115108
>
116-
{result.points.toFixed(1)}
109+
<span
110+
className={cn(
111+
"text-3xl",
112+
result.points === 0 ? 'text-green-400' : null,
113+
result.points > 0 && result.points <= 1.5 ? null : null,
114+
result.points > 1.5 ? 'text-yellow-200' : null,
115+
result.points > 3 ? 'text-orange-400' : null,
116+
result.points >= 5 ? 'text-red-400' : null,
117+
)}
118+
>
119+
{(10 - result.points).toFixed(1)}
120+
</span>{' '}
121+
<span className="text-lg">/ 10</span>
117122
</Results.Column>
118123
</Results.Row>
119124
{toSorted(result.checks, (a, b) => b.points - a.points).map(
@@ -140,7 +145,7 @@ export const SpamAssassin = ({ result }: SpamAssassinProps) => {
140145
check.points > 3 ? 'text-red-400' : null,
141146
)}
142147
>
143-
{check.points.toFixed(1)}
148+
-{check.points.toFixed(1)}
144149
</Results.Column>
145150
</Results.Row>
146151
),

0 commit comments

Comments
 (0)