import { useRouter } from 'next/router' import { Link } from 'components/Link' import type { LearningTrack } from 'components/context/ArticleContext' import { useTranslation } from 'components/hooks/useTranslation' type Props = { track: LearningTrack } export function LearningTrackCard({ track }: Props) { const { locale } = useRouter() const { t } = useTranslation('learning_track_nav') const { trackTitle, trackName, nextGuide, trackProduct, numberOfGuides, currentGuideIndex } = track return (
{trackTitle} {t('current_progress') .replace('{n}', numberOfGuides) .replace('{i}', currentGuideIndex + 1)}
{nextGuide ? ( <> {t('next_guide')}: {nextGuide.title} ) : ( {t('more_guides')} )}
) }