mirror of
https://github.com/linsa-io/linsa.git
synced 2026-03-11 21:05:28 +01:00
* feat: add jazz globa group cons * chore: remove topic selector atom * chore: use jazz from constant * chore: remove delete model and add new topic selector * chore: use jazz group id form constant in search component * chore: use jazz group id form constant in public home route * fix: topic selector in link * fix: topic section in detail topic * chore: update la editor * chore: content header tweak class * chore: add btn variant to topic selector * refactor: tweak border for link header * chore: page header * fix: page detail route
14 lines
527 B
TypeScript
14 lines
527 B
TypeScript
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 }
|
|
}
|