docs(docs): fix cursor handling and hover tip refactor in docs UI components

This commit is contained in:
Prad Nukala committed 2026-10-05 11:23:57 -04:00
1 parent 0d066b8104
commit 7ead021ee2
5 files changed
+24 -18

No files matched your search

+5 -5
View File
@@ -57,14 +57,14 @@ export default function SolvedRing() {
const done = rows.reduce((n, r) => n + r.done, 0);
const span = SWEEP - GAP * (rows.length - 1);
const segments: ((typeof rows)[number] & { from: number; to: number; solvedTo: number })[] = [];
let cursor = START;
const segments = rows.map((r) => {
for (const r of rows) {
const size = total > 0 ? (span * r.total) / total : 0;
const from = cursor;
cursor -= size + GAP;
const solved = r.total > 0 ? size * (r.done / r.total) : 0;
return { ...r, from, to: from - size, solvedTo: from - solved };
});
segments.push({ ...r, from: cursor, to: cursor - size, solvedTo: cursor - solved });
cursor -= size + GAP;
}
const focused = focus ? rows.find((r) => r.difficulty === focus) : undefined;
const arc = { innerRadius: "80%", outerRadius: "88%", cornerRadius: 99, stroke: "none", dataKey: "value" } as const;