'use client'; import type { LearningViewProps } from '@contractspec/example.learning-journey-ui-shared'; import { Card, CardContent, CardHeader, CardTitle, } from '@contractspec/lib.ui-kit-web/ui/card'; import { TipFeed } from '../components/TipFeed'; export function Timeline({ track, progress }: LearningViewProps) { // Create feed items sorted by completion status (completed first for "recent activity") const feedItems = track.steps .map((step) => ({ step, isCompleted: progress.completedStepIds.includes(step.id), completedAt: progress.completedStepIds.includes(step.id) ? 'Recently' : undefined, })) .sort((a, b) => { // Completed items first (as recent activity) if (a.isCompleted && !b.isCompleted) return -1; if (!a.isCompleted && b.isCompleted) return 1; return 0; }); const completedCount = feedItems.filter((f) => f.isCompleted).length; const pendingCount = feedItems.length - completedCount; return (
Your coaching journey and tip history