mirror of
https://github.com/linsa-io/linsa.git
synced 2026-01-12 12:20:23 +01:00
refactor: remove the use of custom hook (#133)
This commit is contained in:
@@ -1,13 +0,0 @@
|
||||
import { useMemo } from "react"
|
||||
import { useCoState } from "@/lib/providers/jazz-provider"
|
||||
import { Account } from "jazz-tools"
|
||||
import { Topic } from "@/lib/schema"
|
||||
import { JAZZ_GLOBAL_GROUP_ID } from "@/lib/constants"
|
||||
|
||||
export function useTopicData(topicName: string, me: Account | undefined) {
|
||||
const topicID = useMemo(() => me && Topic.findUnique({ topicName }, JAZZ_GLOBAL_GROUP_ID, me), [topicName, me])
|
||||
|
||||
const topic = useCoState(Topic, topicID, { latestGlobalGuide: { sections: [{ links: [] }] } })
|
||||
|
||||
return { topic }
|
||||
}
|
||||
Reference in New Issue
Block a user