Files
initiative/apps/web/src/components/ac-shield.tsx
Lukas 36768d3aa1 Upgrade Biome to 2.4.7 and enable 54 additional lint rules
Add rules covering bug prevention (noLeakedRender, noFloatingPromises,
noImportCycles, noReactForwardRef), security (noScriptUrl, noAlert),
performance (noAwaitInLoops, useTopLevelRegex), and code style
(noNestedTernary, useGlobalThis, useNullishCoalescing, useSortedClasses,
plus ~40 more). Fix all violations: extract top-level regex constants,
guard React && renders with boolean coercion, refactor nested ternaries,
replace window with globalThis, sort Tailwind classes, and introduce
expectDomainError test helper to eliminate conditional expects.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 14:25:09 +01:00

38 lines
978 B
TypeScript

import { cn } from "../lib/utils";
interface AcShieldProps {
readonly value: number | undefined;
readonly onClick?: () => void;
readonly className?: string;
}
export function AcShield({ value, onClick, className }: AcShieldProps) {
return (
<button
type="button"
onClick={onClick}
className={cn(
"relative inline-flex items-center justify-center text-muted-foreground text-sm tabular-nums transition-colors hover:text-hover-neutral",
className,
)}
style={{ width: 28, height: 32 }}
>
<svg
viewBox="0 0 28 32"
fill="none"
stroke="currentColor"
strokeWidth={1.5}
strokeLinecap="round"
strokeLinejoin="round"
className="absolute inset-0 h-full w-full"
aria-hidden="true"
>
<path d="M14 1.5 L2.5 6.5 L2.5 15 Q2.5 25 14 30.5 Q25.5 25 25.5 15 L25.5 6.5 Z" />
</svg>
<span className="relative font-medium text-xs leading-none">
{value == null ? "\u2014" : String(value)}
</span>
</button>
);
}