import { useRef } from 'react'; import { Flex } from '@chakra-ui/react'; import { useConfig, useColorValue, useGlobalState } from '~/context'; import { If, Debugger, Greeting, Footer, Header } from '~/components'; import { useGreeting } from '~/hooks'; import type { TFrame } from './types'; export const Frame = (props: TFrame) => { const { web, developer_mode } = useConfig(); const { isSubmitting, formData } = useGlobalState(); const [greetingAck, setGreetingAck] = useGreeting(); const bg = useColorValue('white', 'black'); const color = useColorValue('black', 'white'); const containerRef = useRef({} as HTMLDivElement); function resetForm(): void { containerRef.current.scrollIntoView({ behavior: 'smooth', block: 'start' }); isSubmitting.set(false); formData.set({ query_location: [], query_target: '', query_type: '', query_vrf: '' }); return; } return ( <>