import iconsJson from '../../../assets/admin/icons/icons.json'; /** * Icon entries support two path-shapes: * - bare string: renders with the SVG-level defaults (stroke=currentColor, * fill=none, strokeWidth=1.75). * - object: per-path override for filled accents (play triangle, recording * dot, "?" tittle). Allows the JSON dictionary to be the sole source of * truth for glyphs that previously had to be inlined as TSX. */ type IconPath = string | { d: string; fill?: string; stroke?: string; strokeWidth?: number }; type IconDef = { viewBox?: string; paths: IconPath[] }; const icons = iconsJson as unknown as Record; type Props = { name?: string; className?: string; }; /* * Curriculum content-type glyphs (video, live, quiz, assignment, text, audio, * scorm, h5p) live ENTIRELY in `assets/admin/icons/icons.json` — single source * of truth across PHP + React. KEEP IN SYNC with: * - includes/template-functions.php (PHP curriculum row icon helper) * - templates/partials/learn-icons.php (lesson-shell header icons) */ /** * Drag handle (grip-vertical) — six filled dots in a 2x3 grid. Filled circles * keep the glyph readable down to ~14px where the JSON `h.01` stroke pattern * collapses into faint specks. */ function SvgDragHandle({ className }: { className: string }) { return ( ); } /** * Stroke icon from shared `assets/admin/icons/icons.json` (PHP: Sikshya admin icon registry). */ export function NavIcon({ name, className = 'h-5 w-5 shrink-0' }: Props) { if (!name) { return ; } if (name === 'dragHandle') { return ; } const def = icons[name]; if (!def?.paths?.length) { return ; } const vb = def.viewBox || '0 0 24 24'; return ( {def.paths.map((p, i) => { if (typeof p === 'string') { return ; } return ( ); })} ); }