import { useEffect, useState } from 'react' import cx from 'classnames' import { useRouter } from 'next/router' import { useMainContext } from 'components/context/MainContext' import { Link } from 'components/Link' import { useProductLandingContext } from 'components/context/ProductLandingContext' import { useTranslation } from 'components/hooks/useTranslation' import { useVersion } from 'components/hooks/useVersion' export const LandingHero = () => { const { airGap } = useMainContext() const { product_video, shortTitle, beta_product, intro, introLinks } = useProductLandingContext() const { t } = useTranslation('product_landing') const [renderIFrame, setRenderIFrame] = useState(false) // delay iFrame rendering so that dom ready happens sooner useEffect(() => { setRenderIFrame(true) }, []) return (
Product

{shortTitle}{' '} {beta_product && Beta}

{introLinks && Object.entries(introLinks) .filter(([key, link]) => { return link && !key.includes('raw') }) .map(([key, link], i) => { if (!link) { return null } return ( {t(key)} ) })}
{product_video && (
{!airGap && ( )}
)}
) } // Fully Qualified Link - it includes the version and locale in the path type Props = { href: string children: React.ReactNode className?: string } export const FullLink = ({ href, children, className }: Props) => { const router = useRouter() const { currentVersion } = useVersion() const locale = router.locale || 'en' const fullyQualifiedHref = `/${locale}${ currentVersion !== 'free-pro-team@latest' ? `/${currentVersion}` : '' }${href}` return ( {children} ) }