// ============================================================ // MOORE AI v13 — SHARED COMPONENTS // No import/export — globals loaded in order via index.html // Requires: utils.js loaded first, React global // ============================================================ const { useRef, useEffect } = React; // ========================================================= // ICON COMPONENT (uses lucide globals) // ========================================================= const Icon = ({ name, size = 16, className = '' }) => { const containerRef = useRef(null); useEffect(() => { if (containerRef.current && window.lucide) { containerRef.current.innerHTML = ``; window.lucide.createIcons({ root: containerRef.current }); } }, [name, size, className]); return ; }; // ========================================================= // STATUS BADGE // ========================================================= const StatusBadge = ({ status }) => { const cls = status === 'won' ? 'status-won' : status === 'lost' ? 'status-lost' : 'status-open'; return {status}; }; // ========================================================= // AVATAR // ========================================================= const Avatar = ({ name, size = 36, photo }) => { const bg = avatarBg(name); if (photo) return ; return (
{initials(name)}
); }; // ========================================================= // STAT CARD // ========================================================= const StatCard = ({ label, value, icon, sub, color = '#3b82f6', trend }) => (
{trend && 0 ? 'text-emerald-400' : 'text-red-400'}`}>{trend > 0 ? '+' : ''}{trend}%}
{value}
{label}
{sub &&
{sub}
}
);