"use client" import * as react from "react" import { useCoState } from "@/lib/providers/jazz-provider" import { PublicGlobalGroup } from "@/lib/schema/master/public-group" import { ID } from "jazz-tools" import dynamic from "next/dynamic" import { Button } from "../ui/button" import Link from "next/link" let graph_data_promise = import("./graph-data.json").then(a => a.default) const ForceGraphClient = dynamic(() => import("./force-graph-client-lazy"), { ssr: false }) export function PublicHomeRoute() { let raw_graph_data = react.use(graph_data_promise) const [placeholder, setPlaceholder] = react.useState("Search something...") const [currentTopicIndex, setCurrentTopicIndex] = react.useState(0) const [currentCharIndex, setCurrentCharIndex] = react.useState(0) const globalGroup = useCoState( PublicGlobalGroup, process.env.NEXT_PUBLIC_JAZZ_GLOBAL_GROUP as ID, { root: { topics: [] } } ) const topics = globalGroup?.root.topics?.map(topic => topic?.prettyName) || [] react.useEffect(() => { if (topics.length === 0) return const typingInterval = setInterval(() => { const currentTopic = topics[currentTopicIndex] if (currentTopic && currentCharIndex < currentTopic.length) { setPlaceholder(`${currentTopic.slice(0, currentCharIndex + 1)}`) setCurrentCharIndex(currentCharIndex + 1) } else { clearInterval(typingInterval) setTimeout(() => { setCurrentTopicIndex(prevIndex => (prevIndex + 1) % topics.length) setCurrentCharIndex(0) }, 1000) } }, 200) return () => clearInterval(typingInterval) }, [currentTopicIndex, currentCharIndex, topics]) return (
{ console.log("clicked", val) }} filter_query="" />

Learn Anything

Random Topic

i want to learn

) }