import { useEffect } from 'react'; import { Accordion } from '@chakra-ui/react'; import { AnimatePresence } from 'framer-motion'; import { AnimatedDiv } from '~/components'; import { useDevice, useLGState } from '~/hooks'; import { Result } from './individual'; import { Tags } from './tags'; export const Results: React.FC = () => { const { queryLocation, queryTarget, queryType, queryVrf, queryGroup } = useLGState(); const getDevice = useDevice(); // Scroll to the top of the page when results load - primarily for mobile. useEffect(() => { if (typeof window !== 'undefined') { window.scrollTo(0, 0); } }, []); return ( <> {queryLocation.value && queryLocation.map((loc, i) => { const device = getDevice(loc.value); return ( ); })} ); };