Files
community-rule/app/components/sections/SectionNumber.tsx
T
adilalloandCursor b6cf980d23 Keep process-card numerals upright and match Display type and section gaps.
Rotate only the numbered shapes, use 24/32 and 32/1.1 card copy, and tighten the header-to-CTA stack.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-18 20:46:28 -06:00

40 lines
1.1 KiB
TypeScript

"use client";
/**
* Figma: "Sections / SectionNumber" (see registry)
*/
import { memo } from "react";
import { getAssetPath, sectionNumberPath } from "../../../lib/assetUtils";
interface SectionNumberProps {
number: number;
}
const SectionNumber = memo<SectionNumberProps>(({ number }) => {
const getImageSrc = (num: number): string => {
const n = num === 2 || num === 3 ? num : 1;
return getAssetPath(sectionNumberPath(n));
};
return (
<div className="relative size-[40px] overflow-visible">
{/* eslint-disable-next-line @next/next/no-img-element -- dynamic src from getImageSrc */}
<img
src={getImageSrc(number)}
alt={`Section ${number}`}
className="absolute left-1/2 top-1/2 size-[47.37px] max-w-none -translate-x-1/2 -translate-y-1/2 rotate-15"
/>
<div className="absolute inset-0 flex items-center justify-center">
<span className="text-large-label text-[var(--color-content-invert-primary)]">
{number}
</span>
</div>
</div>
);
});
SectionNumber.displayName = "SectionNumber";
export default SectionNumber;