1
0
mirror of synced 2026-01-04 09:06:46 -05:00
Files
docs/components/sidebar/AllProductsLink.tsx
2022-10-12 17:04:23 +00:00

23 lines
690 B
TypeScript

import { useRouter } from 'next/router'
import { ArrowLeftIcon } from '@primer/octicons-react'
import { DEFAULT_VERSION, useVersion } from 'components/hooks/useVersion'
import { Link } from 'components/Link'
export const AllProductsLink = () => {
const router = useRouter()
const { currentVersion } = useVersion()
const currentVersionPathSegment = currentVersion === DEFAULT_VERSION ? '' : `/${currentVersion}`
return (
<li>
<Link
href={`/${router.locale}${currentVersionPathSegment}`}
className="f6 pl-4 pr-5 ml-n1 pb-1 color-fg-default"
>
<ArrowLeftIcon size="small" className="mr-1" />
All products
</Link>
</li>
)
}