Import source: app/src/lib/icon

Import the existing local project snapshot. This commit organizes existing files; it does not represent newly developed functionality.
This commit is contained in:
arsam
2026-09-18 23:24:42 +03:30
parent 88b716e2c6
commit 92eddb8af0
+17
View File
@@ -0,0 +1,17 @@
// Renders an imported `.svg` icon URL as a currentColor mask-icon (see `.tek-icon`
// in global.css), or passes a text glyph through unchanged. Used at render sites
// whose data arrays mix SVG icons with non-emoji text symbols (arrows, geometric
// bullets, ✓/✗). Icons are imported per use site as plain `.svg` files — this is a
// thin render switch, not a name-keyed icon registry.
export function iconNode(value, style) {
if (typeof value === 'string' && value.endsWith('.svg')) {
return (
<span
className="tek-icon"
aria-hidden="true"
style={style ? { ['--i']: `url("${value}")`, ...style } : { ['--i']: `url("${value}")` }}
/>
);
}
return value;
}