'use client'; import type { LearningViewProps } from '@contractspec/example.learning-journey-ui-shared'; import { BadgeDisplay, StreakCounter, XpBar, } from '@contractspec/example.learning-journey-ui-shared'; import { Button } from '@contractspec/lib.design-system'; import { Card, CardContent, CardHeader, CardTitle, } from '@contractspec/lib.ui-kit-web/ui/card'; interface GamifiedOverviewProps extends LearningViewProps { onStart?: () => void; } export function Overview({ track, progress, onStart }: GamifiedOverviewProps) { const totalXp = track.totalXp ?? track.steps.reduce((sum, s) => sum + (s.xpReward ?? 0), 0) + (track.completionRewards?.xp ?? 0); const completedSteps = progress.completedStepIds.length; const totalSteps = track.steps.length; const isComplete = completedSteps === totalSteps; return (
{track.description}
{nextStep.description}
You've mastered all {totalSteps} challenges and earned{' '} {progress.xpEarned} XP.