import { FeaturedTrack } from "components/context/ProductSubLandingContext"; import { useTranslation } from "components/hooks/useTranslation"; import { ArrowRightIcon } from '@primer/octicons-react' import { useState } from "react"; type Props = { track: FeaturedTrack, } export const LearningTrack = ({ track }: Props) => { const guides = track.guides const [ visibleGuides, setVisibleGuides ] = useState(guides?.slice(0, 4)) const showAll = () => { setVisibleGuides(guides) } const { t } = useTranslation('product_sublanding') return (
{track.title}

{track.description}

{t('start')}
{visibleGuides?.map((guide) =>
{guides && {guides?.indexOf(guide)+1}}
{guide.title}
{t('guide_types')[guide.page.type]}
{guides && guides?.indexOf(guide) == 3 ? (
Show more guides
) :
}
)}
) }