mirror of
https://github.com/linsa-io/linsa.git
synced 2026-04-21 07:51:38 +02:00
chore(topic): Enhancement using virtual (#164)
* chore: use tanstack virtual * fix: topic learning state * chore: add skeleton loading and not found topic placeholder * fix: personal links load in list
This commit is contained in:
@@ -1,15 +0,0 @@
|
||||
import { useMemo } from "react"
|
||||
import { useCoState } from "@/lib/providers/jazz-provider"
|
||||
import { PublicGlobalGroup } from "@/lib/schema/master/public-group"
|
||||
import { Account, AnonymousJazzAgent, ID } from "jazz-tools"
|
||||
import { Link, Topic } from "@/lib/schema"
|
||||
|
||||
const GLOBAL_GROUP_ID = process.env.NEXT_PUBLIC_JAZZ_GLOBAL_GROUP as ID<PublicGlobalGroup>
|
||||
|
||||
export function useTopicData(topicName: string, me: Account | AnonymousJazzAgent | undefined) {
|
||||
const topicID = useMemo(() => me && Topic.findUnique({ topicName }, GLOBAL_GROUP_ID, me), [topicName, me])
|
||||
|
||||
const topic = useCoState(Topic, topicID, { latestGlobalGuide: { sections: [{ links: [] }] } })
|
||||
|
||||
return { topic }
|
||||
}
|
||||
Reference in New Issue
Block a user