mirror of
https://github.com/mgeeky/decode-spam-headers.git
synced 2026-02-22 05:23:31 +01:00
MAESTRO: fix formatting for report lint
This commit is contained in:
@@ -3,31 +3,20 @@
|
||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||
import { faTriangleExclamation } from "@fortawesome/free-solid-svg-icons";
|
||||
|
||||
import type {
|
||||
AnalysisReport,
|
||||
TestResult,
|
||||
TestSeverity,
|
||||
TestStatus,
|
||||
} from "../types/analysis";
|
||||
import type { AnalysisReport, TestResult, TestSeverity, TestStatus } from "../types/analysis";
|
||||
|
||||
type AnalysisResultsProps = {
|
||||
report: AnalysisReport;
|
||||
};
|
||||
|
||||
const severityStyles: Record<
|
||||
TestSeverity,
|
||||
{ label: string; className: string }
|
||||
> = {
|
||||
const severityStyles: Record<TestSeverity, { label: string; className: string }> = {
|
||||
spam: { label: "Spam", className: "text-spam border-spam/40" },
|
||||
suspicious: { label: "Suspicious", className: "text-suspicious border-suspicious/40" },
|
||||
clean: { label: "Clean", className: "text-clean border-clean/40" },
|
||||
info: { label: "Info", className: "text-accent border-accent/40" },
|
||||
};
|
||||
|
||||
const statusStyles: Record<
|
||||
TestStatus,
|
||||
{ label: string; className: string }
|
||||
> = {
|
||||
const statusStyles: Record<TestStatus, { label: string; className: string }> = {
|
||||
success: { label: "Success", className: "text-clean border-clean/40" },
|
||||
error: { label: "Error", className: "text-spam border-spam/40" },
|
||||
skipped: { label: "Skipped", className: "text-suspicious border-suspicious/40" },
|
||||
@@ -45,9 +34,7 @@ export default function AnalysisResults({ report }: AnalysisResultsProps) {
|
||||
className="rounded-2xl border border-info/10 bg-surface p-6 shadow-[0_0_40px_rgba(15,23,42,0.25)]"
|
||||
>
|
||||
<div className="flex flex-wrap items-center justify-between gap-3">
|
||||
<span className="text-xs uppercase tracking-[0.2em] text-info/90">
|
||||
Analysis Report
|
||||
</span>
|
||||
<span className="text-xs uppercase tracking-[0.2em] text-info/90">Analysis Report</span>
|
||||
<span className="font-mono text-[10px] text-text/50">
|
||||
{report.metadata.passedTests} passed / {report.metadata.failedTests} failed
|
||||
</span>
|
||||
@@ -66,22 +53,16 @@ export default function AnalysisResults({ report }: AnalysisResultsProps) {
|
||||
>
|
||||
<div className="flex flex-wrap items-center justify-between gap-3">
|
||||
<div className="flex flex-col">
|
||||
<span className="text-sm font-semibold text-text/90">
|
||||
{result.testName}
|
||||
</span>
|
||||
<span className="text-sm font-semibold text-text/90">{result.testName}</span>
|
||||
<span className="text-xs text-text/50">
|
||||
Test #{result.testId} · {result.headerName}
|
||||
</span>
|
||||
</div>
|
||||
<div className="flex flex-wrap items-center gap-2 text-[11px] uppercase tracking-[0.2em]">
|
||||
<span
|
||||
className={`rounded-full border px-2 py-1 ${statusStyle.className}`}
|
||||
>
|
||||
<span className={`rounded-full border px-2 py-1 ${statusStyle.className}`}>
|
||||
{statusStyle.label}
|
||||
</span>
|
||||
<span
|
||||
className={`rounded-full border px-2 py-1 ${severityStyle.className}`}
|
||||
>
|
||||
<span className={`rounded-full border px-2 py-1 ${severityStyle.className}`}>
|
||||
{severityStyle.label}
|
||||
</span>
|
||||
</div>
|
||||
@@ -102,8 +83,7 @@ export default function AnalysisResults({ report }: AnalysisResultsProps) {
|
||||
>
|
||||
<FontAwesomeIcon icon={faTriangleExclamation} className="mt-0.5" />
|
||||
<span>
|
||||
<span className="font-semibold">Error:</span>{" "}
|
||||
{getErrorMessage(result)}
|
||||
<span className="font-semibold">Error:</span> {getErrorMessage(result)}
|
||||
</span>
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
Reference in New Issue
Block a user