/* @component-map * App — Main container, tab navigation [app.jsx] * ModuleBrowser — Browse and take learning modules [components/ModuleBrowser.jsx] * ModuleCreator — Create new learning modules [components/ModuleCreator.jsx] * ModulePlayer — Take a module lesson + quiz [components/ModulePlayer.jsx] * ProgressDashboard — Track scores, badges, completions [components/ProgressDashboard.jsx] * SalesChart — Reusable bar chart component powered by Deplixo SDK rendering. * @end-component-map */ import { useMemo, useState } from 'react'; import { useAuth, renderChart } from '@deplixo/sdk'; import { ModuleBrowser } from './components/ModuleBrowser.jsx'; import { ModuleCreator } from './components/ModuleCreator.jsx'; import { ProgressDashboard } from './components/ProgressDashboard.jsx'; function App() { const { user, loading, login, logout } = useAuth(); const [tab, setTab] = useState('browse'); const tabs = [ { id: 'browse', label: '📚 Modules', icon: '📚' }, { id: 'create', label: '✏️ Create', icon: '✏️' }, { id: 'progress', label: '🏆 Progress', icon: '🏆' }, ]; const displayName = useMemo(() => user?.name || user?.email || 'Learner', [user]); if (loading) { return (
); } if (!user) { return (

🧠 LearnBit

Bite-sized learning, lasting knowledge

📚

Sign in to continue

Use Google OAuth to access your saved modules, track progress, and earn badges.

Learner accounts are protected by Deplixo authentication.

); } return (
{user.avatar ? {displayName} : {displayName.charAt(0).toUpperCase()}}
Welcome, {displayName} Learner account

🧠 LearnBit

Bite-sized learning, lasting knowledge

{tab === 'browse' && } {tab === 'create' && } {tab === 'progress' && }
); } export default App; function SalesChart({ data }) { const canvasRef = useRef(null); useEffect(() => { if (canvasRef.current && data.length > 0) { renderChart(canvasRef.current, { type: "bar", data: { labels: data.map(d => d.label), datasets: [{ label: "Sales", data: data.map(d => d.value) }] } }); } }, [data]); return ; } ReactDOM.createRoot(document.getElementById('root')).render();