import React from "react"; import Link from "next/link"; import { useSnapshot } from "valtio"; import { useRouter } from "next/router"; import { FolderOpen, X, ArrowUpRight, BookOpen } from "phosphor-react"; import Stack from "./Stack"; import Logo from "./Logo"; import Button from "./Button"; import Flex from "./Flex"; import Container from "./Container"; import Box from "./Box"; import ThemeChanger from "./ThemeChanger"; import state from "../state"; import Heading from "./Heading"; import Text from "./Text"; import Spinner from "./Spinner"; import truncate from "../utils/truncate"; import ButtonGroup from "./ButtonGroup"; import { Dialog, DialogClose, DialogContent, DialogDescription, DialogTitle, DialogTrigger, } from "./Dialog"; import PanelBox from "./PanelBox"; import { templateFileIds } from "../state/constants"; import { styled } from "../stitches.config"; const ImageWrapper = styled(Flex, { position: "relative", mt: "$2", mb: "$10", svg: { // fill: "red", ".angle": { fill: "$text", }, ":not(.angle)": { stroke: "$text", }, }, }); const Navigation = () => { const router = useRouter(); const snap = useSnapshot(state); const slug = router.query?.slug; const gistId = Array.isArray(slug) ? slug[0] : null; return ( {snap.loading ? ( ) : ( <> {snap.files?.[0]?.name || "XRPL Hooks"} {snap.files.length > 0 ? "Gist: " : "Builder"} {snap.files.length > 0 && ( {`${snap.gistOwner || "-"}/${truncate( snap.gistId || "" )}`} )} )} {router.isReady && ( (state.mainModalOpen = open)} > XRPL Hooks Builder Hooks add smart contract functionality to the XRP Ledger. Hooks Github Hooks documentation XRPL documentation {Object.values(templateFileIds).map((template) => ( {template.icon()} {template.name} {template.description} ))} )} ); }; export default Navigation;