import { ConnectButton, useCurrentAccount } from "@onelabs/dapp-kit"; import { isValidSuiObjectId } from "@onelabs/sui/utils"; import { Box, Container, Flex, Heading } from "@radix-ui/themes"; import { useState } from "react"; import { Counter } from "./Counter"; import { CreateCounter } from "./CreateCounter"; function App() { const currentAccount = useCurrentAccount(); const [counterId, setCounter] = useState(() => { const hash = window.location.hash.slice(1); return isValidSuiObjectId(hash) ? hash : null; }); return ( <> dApp Starter Template {currentAccount ? ( counterId ? ( ) : ( { window.location.hash = id; setCounter(id); }} /> ) ) : ( Please connect your wallet )} ); } export default App;