import React, { useRef, useState } from "react"; import { Plus, Share, DownloadSimple, Gear, X } from "phosphor-react"; import { useTheme } from "next-themes"; import { createNewFile, state, updateEditorSettings } from "../state"; import Box from "./Box"; import Button from "./Button"; import Container from "./Container"; import { Dialog, DialogTrigger, DialogContent, DialogTitle, DialogDescription, DialogClose, } from "./Dialog"; import Flex from "./Flex"; import Stack from "./Stack"; import { useSnapshot } from "valtio"; import { useSession } from "next-auth/react"; import { useRouter } from "next/router"; import Input from "./Input"; const EditorNavigation = () => { const snap = useSnapshot(state); const [filename, setFilename] = useState(""); const { theme } = useTheme(); const { data: session, status } = useSession(); const router = useRouter(); const [editorSettings, setEditorSettings] = useState(snap.editorSettings); return ( {state.loading && "loading"} {snap.files && snap.files.length > 0 && snap.files?.map((file, index) => ( ))} Create new file setFilename(e.target.value)} /> Share hook We will store your hook code in public GitHub Gist and generate link to that Editor settings setEditorSettings((curr) => ({ ...curr, tabSize: Number(e.target.value), })) } /> ); }; export default EditorNavigation;