import { useRef } from 'react'; import dynamic from 'next/dynamic'; import classNames from 'classnames'; import { Heading, View } from '@aws-amplify/ui-react'; import { useIntersectionObserver } from '@/components/useIntersection'; import { trackScroll } from '@/utils/track'; // react-live does not work with SSR so we have to load // it dynamically and only in the client const HomeEditor = dynamic(() => import('../HomeEditor'), { ssr: false, }) as React.FC; export const LiveSection = ({ platform, ...rest }) => { const ref = useRef(null); const entry = useIntersectionObserver(ref, { threshold: 0.125, freezeOnceVisible: true, }); const isVisible = !!entry?.isIntersecting; if (isVisible) { trackScroll('Home#Live'); } return ( Take it for a test drive ); };