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
+8 -7
View File
@@ -38,15 +38,16 @@ const FLAG_LABELS: Record<string, string> = {
const ALL_FLAGS = Object.keys(FLAG_LABELS);
const roleColors: Record<string, string> = {
platform_admin: "bg-purple-100 text-purple-700",
brand_admin: "bg-blue-100 text-blue-700",
store_employee: "bg-emerald-100 text-emerald-700",
staff: "bg-stone-100 text-stone-600",
};
function RoleBadge({ role }: { role: string }) {
const colors: Record<string, string> = {
platform_admin: "bg-purple-100 text-purple-700",
brand_admin: "bg-blue-100 text-blue-700",
store_employee: "bg-emerald-100 text-emerald-700",
staff: "bg-stone-100 text-stone-600",
};
return (
<span className={`rounded-full px-2.5 py-0.5 text-xs font-semibold capitalize ${colors[role] ?? "bg-stone-100 text-stone-600"}`}>
<span className={`rounded-full px-2.5 py-0.5 text-xs font-semibold capitalize ${roleColors[role] ?? "bg-stone-100 text-stone-600"}`}>
{role.replace("_", " ")}
</span>
);