import { styled } from "goober"; import { useNode } from "../contexts/node"; import { Heading } from "../ui/heading"; import { Button, Input } from "../ui"; import { useState } from "react"; import { CoID, RawCoValue } from "cojson"; import { useRouter } from "../router"; import { DeleteLocalData } from "../viewer/delete-local-data.js"; export interface HomePageProps { showDeleteLocalData?: boolean; } export function HomePage({ showDeleteLocalData }: HomePageProps) { const { localNode, accountID } = useNode(); const { path, setPage } = useRouter(); const [coValueId, setCoValueId] = useState | "">(""); if (!localNode || !accountID) { return
Loading...
; } const handleCoValueIdSubmit = (e: React.FormEvent) => { e.preventDefault(); if (coValueId) { setPage(coValueId); } setCoValueId(""); }; return ( Jazz CoValue Inspector setCoValueId(e.target.value as CoID)} /> or {showDeleteLocalData && ( )} ); } const PageContainer = styled("div")` position: relative; height: 100%; width: 100%; `; const CenteredForm = styled("form")` display: flex; flex-direction: column; position: relative; top: -1.5rem; justify-content: center; gap: 0.5rem; height: 100%; width: 100%; max-width: 24rem; margin: 0 auto; `; const OrText = styled("p")` text-align: center; `; const BottomRight = styled("div")` position: absolute; bottom: 0.75rem; right: 0; `;