// Course Builder screen — module/lesson tree with learning path. const TYPE_META = { video: { ic: 'play', color: 'oklch(0.72 0.10 30)', fa: 'ویدیو' }, pdf: { ic: 'pdf', color: 'oklch(0.72 0.10 80)', fa: 'PDF' }, audio: { ic: 'audio', color: 'oklch(0.72 0.10 200)', fa: 'صوت' }, task: { ic: 'edit', color: 'oklch(0.72 0.10 140)', fa: 'تمرین' }, quiz: { ic: 'quiz', color: 'oklch(0.72 0.10 260)', fa: 'آزمون' }, }; function LessonRow({ lesson, selected, onSelect }) { const m = TYPE_META[lesson.type]; return (
onSelect(lesson.id)} style={{ display: 'flex', alignItems: 'center', gap: 12, padding: '10px 14px', borderRadius: 'var(--r-sm)', background: selected ? 'var(--accent-soft)' : 'transparent', border: '1px solid ' + (selected ? 'transparent' : 'transparent'), cursor: 'pointer', transition: 'background .12s', }} onMouseEnter={(e) => { if (!selected) e.currentTarget.style.background = 'var(--surface-2)'; }} onMouseLeave={(e) => { if (!selected) e.currentTarget.style.background = 'transparent'; }} >
{lesson.title}
{m.fa} · {lesson.duration} {lesson.preview && · پیش‌نمایش رایگان}
{lesson.status === 'draft' ? پیش‌نویس : }
); } function ModuleBlock({ mod, selectedLesson, onSelect, onToggle }) { const lessonCount = mod.lessons.length; const totalMin = mod.lessons.reduce((s, l) => s + (parseInt(l.duration) || 0), 0); return (
onToggle(mod.id)} style={{ display: 'flex', alignItems: 'center', gap: 10, padding: '14px 18px', cursor: 'pointer', userSelect: 'none' }}>
{mod.title}
{lessonCount} درس · {totalMin > 0 ? `${totalMin} دقیقه` : 'بدون زمان‌بندی'}
{mod.expanded && (
{mod.lessons.map(l => ( ))}
)}
); } function LessonInspector({ lesson }) { if (!lesson) return null; const m = TYPE_META[lesson.type]; return (
{/* preview frame */}
{lesson.duration} {m.fa}