import React from "react"
import { Box, Center, Flex } from "@chakra-ui/react"
import { Link, useLocation, useNavigate } from "@remix-run/react"
import { Commander } from "../Commander/Commander"
import { CommanderV1 } from "../Commander/CommanderV1"
import { Icon } from "../Icon/Icon"
import { RainbowSkeleton } from "../Skeleton/RainbowSkeleton"
import { ProfileDrawer } from "./ProfileDrawer"
export const Nav = (props) => {
const [profileDrawerOpen, setProfileDrawerOpen] = React.useState(false)
const { pathname } = useLocation()
const navigate = useNavigate()
const toggleProfileDrawer = React.useCallback(() => {
setProfileDrawerOpen(!profileDrawerOpen)
}, [profileDrawerOpen])
const inEditMode = React.useMemo(() => {
if (pathname.slice(0, 5) === "/edit") {
return true
}
return false
}, [pathname])
const editorToggleable = React.useMemo(() => {
if (pathname.slice(0, 7) === "/things") {
return true
} else if (pathname.slice(0, 5) === "/edit") {
return true
}
return false
}, [pathname])
const toggleEditor = React.useCallback(
(e) => {
// if first characters of pathname are /things replace with /edit
// or if first characters of pathname are /edit replace with /things
if (pathname.slice(0, 7) === "/things") {
const newPathname = pathname.replace("/things", "/edit")
e?.preventDefault?.()
navigate(newPathname)
} else if (pathname.slice(0, 5) === "/edit") {
const newPathname = pathname.replace("/edit", "/things")
e?.preventDefault?.()
navigate(newPathname)
}
},
[pathname, navigate]
)
return (
<>
{editorToggleable && (
{/* */}
)}
{/* */}
{/*
*/}
{/* */}
>
)
}