fix: Better highlight warnings in SecurityWarningBanner.tsx
This commit is contained in:
@@ -13,27 +13,27 @@ export function SecurityWarningBanner({status}: SecurityWarningBannerProps) {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const sevenDayBounceRate = status.sevenDay.bounceRate.toFixed(2);
|
|
||||||
const sevenDayComplaintRate = status.sevenDay.complaintRate.toFixed(3);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Alert variant="warning">
|
<Alert variant="warning">
|
||||||
<AlertTriangle className="h-4 w-4" />
|
<AlertTriangle className="h-4 w-4" />
|
||||||
<AlertTitle>Security Warning - Action Required</AlertTitle>
|
<AlertTitle>Security Warning - Action Required</AlertTitle>
|
||||||
<AlertDescription className="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3">
|
<AlertDescription className="flex flex-col sm:flex-row sm:items-start sm:justify-between gap-3">
|
||||||
<div className="space-y-1">
|
<div className="space-y-2 flex-1">
|
||||||
<p className="text-sm">
|
<p className="text-sm font-medium">
|
||||||
Your project has exceeded security thresholds. Current rates: 7-day bounce rate{' '}
|
Your project has exceeded the following security thresholds:
|
||||||
<strong>{sevenDayBounceRate}%</strong>, 7-day complaint rate{' '}
|
|
||||||
<strong>{sevenDayComplaintRate}%</strong>.
|
|
||||||
</p>
|
</p>
|
||||||
<p className="text-xs text-amber-800">
|
<ul className="list-disc list-inside space-y-1 text-sm text-amber-800">
|
||||||
|
{status.warnings.map((warning, idx) => (
|
||||||
|
<li key={idx}>{warning}</li>
|
||||||
|
))}
|
||||||
|
</ul>
|
||||||
|
<p className="text-xs text-amber-800 mt-2">
|
||||||
High bounce or complaint rates can lead to project suspension. Review the detailed metrics
|
High bounce or complaint rates can lead to project suspension. Review the detailed metrics
|
||||||
and take action to improve your email quality.
|
and take action to improve your email quality.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<Link href="/settings?tab=security">
|
<Link href="/settings?tab=security">
|
||||||
<Button size="sm" variant="outline" className="w-full sm:w-auto">
|
<Button size="sm" variant="outline" className="w-full sm:w-auto flex-shrink-0">
|
||||||
View Details
|
View Details
|
||||||
</Button>
|
</Button>
|
||||||
</Link>
|
</Link>
|
||||||
|
|||||||
Reference in New Issue
Block a user