import { ArrowRightIcon, ArrowUpIcon, FileIcon, ListUnorderedIcon } from '@primer/octicons-react'
import { useMainContext } from 'components/context/MainContext'
import { useProductLandingContext } from 'components/context/ProductLandingContext'
import { useTranslation } from 'components/hooks/useTranslation'
import { Link } from 'components/Link'
import { useRouter } from 'next/router'
export function ProductReleases() {
const { t } = useTranslation('product_landing')
const router = useRouter()
const { enterpriseServerReleases, allVersions } = useMainContext()
const { releases } = useProductLandingContext()
const currentPath = router.asPath.split('?')[0]
return (
{releases.map((release) => {
const releaseNumber = release.version
if (!enterpriseServerReleases.supported.includes(releaseNumber)) {
return null
}
const releaseVersion = `enterprise-server@${releaseNumber}`
const latestPatch = release.patches[0]
const firstPreviousVersion = `enterprise-server@${release.firstPreviousRelease}`
const secondPreviousVersion = `enterprise-server@${release.secondPreviousRelease}`
return (
{allVersions[releaseVersion].versionTitle}
{' '}
{t('release_notes_for')} {latestPatch.version}
{' '}
({latestPatch.date})
{t('upgrade_from')}{' '}
{release.firstPreviousRelease}
{' '}
or{' '}
{release.secondPreviousRelease}
{' '}
{t('browse_all_docs')}
)
})}
{t('explore_release_notes')}
)
}