import { useRef } from 'react'; import { Flex } from '@chakra-ui/react'; import { isSafari } from 'react-device-detect'; import { If, Debugger, Greeting, Footer, Header } from '~/components'; import { useConfig, useColorValue } from '~/context'; import { useLGState, useLGMethods } from '~/hooks'; import { ResetButton } from './resetButton'; import type { TFrame } from './types'; export const Frame = (props: TFrame) => { const { developer_mode } = useConfig(); const { isSubmitting } = useLGState(); const { resetForm } = useLGMethods(); const bg = useColorValue('white', 'black'); const color = useColorValue('black', 'white'); const containerRef = useRef({} as HTMLDivElement); function handleReset(): void { containerRef.current.scrollIntoView({ behavior: 'smooth', block: 'start' }); isSubmitting.set(false); resetForm(); } return ( <>