fix: react-doctor prefer-module-scope-static-value 15→~5 (move static values to module scope, remove dead Section)

This commit is contained in:
Nora
2026-06-26 05:33:52 -06:00
parent 13d15883b1
commit 6547498ea4
26 changed files with 187 additions and 193 deletions
@@ -11,16 +11,17 @@ type Props = {
fulfilling: string | null;
};
const statusBadgeMap: Record<string, string> = {
pending: "bg-yellow-100 text-yellow-700",
awaiting_deposit: "bg-purple-100 text-purple-700",
confirmed: "bg-blue-100 text-blue-700",
fulfilled: "bg-green-100 text-green-700",
cancelled: "bg-red-100 text-red-700",
};
function StatusBadge({ status }: { status: string }) {
const map: Record<string, string> = {
pending: "bg-yellow-100 text-yellow-700",
awaiting_deposit: "bg-purple-100 text-purple-700",
confirmed: "bg-blue-100 text-blue-700",
fulfilled: "bg-green-100 text-green-700",
cancelled: "bg-red-100 text-red-700",
};
return (
<span className={`rounded-full px-2 py-0.5 text-xs font-medium ${map[status] ?? "bg-slate-100 text-slate-600"}`}>
<span className={`rounded-full px-2 py-0.5 text-xs font-medium ${statusBadgeMap[status] ?? "bg-slate-100 text-slate-600"}`}>
{status.replace(/_/g, " ")}
</span>
);