'use client' import { WorkspaceLabel } from '@/components/learning/LibraryWorkspace' import { masteryTopicRoute } from '@/lib/learning-routes' import Link from 'next/link' import { useTranslation } from 'react-i18next' import { CircleCheck, Route } from 'lucide-react' import type { MasteryTopic } from '@/lib/learning-api' import { topicDisplayName } from './format' import { LearningCardContent } from '@/components/learning/LearningCard' export function TopicMapCard({ topic }: { topic: MasteryTopic }) { const { t } = useTranslation() const { map, metadata } = topic const total = map.counts.total const mastered = map.counts.mastered const progress = total ? mastered / total : 0 const displayName = topicDisplayName(topic, t) return (
: } updatedAt={topic.updated_at} progress={progress} />
{t('{{count}} modules', { count: map.modules.length })} {mastered}/{total} {t('knowledge points')} {t('{{count}} sessions', { count: topic.session_count })}
) }