'use client'; import { CoachingMiniApp } from '@contractspec/example.learning-journey-ui-coaching'; import { GamifiedMiniApp } from '@contractspec/example.learning-journey-ui-gamified'; import { OnboardingMiniApp } from '@contractspec/example.learning-journey-ui-onboarding'; import type { LearningView } from '@contractspec/example.learning-journey-ui-shared'; import { useMemo } from 'react'; import { getLearningAppType, getLearningTrack } from './template-config'; interface LearningMiniAppProps { initialView?: LearningView; onViewChange?: (view: LearningView) => void; templateId: string; } function MissingLearningTemplate({ templateId }: { templateId: string }) { return (

Unknown learning template: {templateId}

); } /** Router component that picks the correct mini-app based on template ID */ export function LearningMiniApp({ templateId, initialView = 'overview', onViewChange, }: LearningMiniAppProps) { const track = useMemo(() => getLearningTrack(templateId), [templateId]); const appType = getLearningAppType(templateId); if (!track || !appType) { return ; } switch (appType) { case 'gamified': return ( ); case 'onboarding': return ( ); case 'coaching': return ( ); default: return ; } } export function LearningTrackList({ templateId }: { templateId?: string }) { if (!templateId) return ; return ; } export function LearningTrackDetail({ templateId }: { templateId?: string }) { if (!templateId) return ; return ; } export function LearningTrackProgressWidget({ templateId, }: { templateId?: string; }) { if (!templateId) return ; return ; }