import { Fragment, useContext, useEffect, useRef, useState } from "react" import { useRouter } from "next/router" import { Event, getAllLocalStorageItems, getRefValue, getRefValues, isTrue, preventDefault, refs, set_val, spreadArraysOrObjects, uploadFiles, useEventLoop } from "/utils/state" import { ColorModeContext, EventLoopContext, initialEvents, StateContext } from "/utils/context.js" import "focus-visible/dist/focus-visible" import { Box, Heading, HStack, Image, Input, Link, Menu, MenuButton, MenuDivider, MenuItem, MenuList, Modal, ModalBody, ModalContent, ModalHeader, ModalOverlay, Spacer, Text, VStack } from "@chakra-ui/react" import { getEventURL } from "/utils/state.js" import NextLink from "next/link" import ReactDropzone from "react-dropzone" import { HamburgerIcon } from "@chakra-ui/icons" import NextHead from "next/head" export default function Component() { const state = useContext(StateContext) const router = useRouter() const [ colorMode, toggleColorMode ] = useContext(ColorModeContext) const focusRef = useRef(); // Main event loop. const [addEvents, connectError] = useContext(EventLoopContext) // Set focus to the specified element. useEffect(() => { if (focusRef.current) { focusRef.current.focus(); } }) // Route after the initial page hydration. useEffect(() => { const change_complete = () => addEvents(initialEvents()) router.events.on('routeChangeComplete', change_complete) return () => { router.events.off('routeChangeComplete', change_complete) } }, [router]) const [files, setFiles] = useState([]); return ( {isTrue(connectError !== null) ? ( {`Connection Error`} {`Cannot connect to server: `} {(connectError !== null) ? connectError.message : ''} {`. Check if server is reachable at `} {getEventURL().href} ) : ( )} {`Strona główna`} {`Dashboard`} {`Settings`} {`BlurMe`} {`Dodaj zdjęcie, które chcesz zanonimizować`} setFiles((files) => e)}> {({ getRootProps, getInputProps }) => ( {`Drag and drop files here or click to select files`} )} {`Strona główna`} {`Dashboard`} {`Settings`} {`About`} {`Contact`} {`Settings`} ) }